Solved

DateTime.Now.ToShortDateString() and subtract 6 months

Posted on 2009-07-01
4
593 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
ID: 24755534
DateTime.Now.AddMonths(-6).ToShortTimeString();
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 166 total points
ID: 24755540
have you tried:

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

Accepted Solution

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

Open in new window

0
 

Author Closing Comment

by:Mr_Shaw
ID: 31598812
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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