Solved

DateTime.Now.ToShortDateString() and subtract 6 months

Posted on 2009-07-01
4
581 Views
Last Modified: 2013-12-17
I am using DateTime.Now.ToShortDateString() to return todays date.

How am i able to use DateTime.Now.ToShortDateString() and subtract 6 months from it?
0
Comment
Question by:Mr_Shaw
4 Comments
 
LVL 22

Assisted Solution

by:p_davis
p_davis earned 166 total points
Comment Utility
DateTime.Now.AddMonths(-6).ToShortTimeString();
0
 
LVL 69

Assisted Solution

by:Éric Moreau
Éric Moreau earned 166 total points
Comment Utility
have you tried:

DateTime.Now.addmonth(-6).ToShortDateString()
0
 
LVL 9

Accepted Solution

by:
Rahul Goel earned 168 total points
Comment Utility
Here is the solution
DateTime.Now.AddMonths(-6).ToShortDateString()

Open in new window

0
 

Author Closing Comment

by:Mr_Shaw
Comment Utility
thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now