Click here to Skip to main content
16,021,112 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to generate datetime after 6 month using a today's date in single varible.
Posted
Comments
Sergey Alexandrovich Kryukov 4-May-12 22:44pm    
Reason for my vote of 1
Aha, in a single variable. And after 5 months, not 7. Please tell us who prevents you from generated what you want.

And it's good to tag you platform, language, whatever else which is relevant to the question...

--SA

1 solution

Try:
C#
DateTime SixMonthsOn = DateTime.Now.AddMonths(6);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900