Click here to Skip to main content
15,889,266 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hello,
in my website i have a current date of system and i want to see 3 month before day from the current date.
tell me the solution....
please.........
Posted
Updated 17-Mar-11 2:02am
v2

Try:
C#
DateTime now = DateTime.Now;
DateTime then = now.AddMonths(-3);
Console.WriteLine(then.ToString());

Or in VB:
VB
Dim now As DateTime = DateTime.Now
Dim past As DateTime = now.AddMonths(-3)
Console.WriteLine(past.ToString())
 
Share this answer
 
Comments
#realJSOP 17-Mar-11 8:33am    
Proposed as answer
fjdiewornncalwe 17-Mar-11 9:42am    
Naturally this is the answer. +5.
go through the below google search link

Here[^]
 
Share this answer
 
Comments
raju melveetilpurayil 17-Mar-11 8:24am    
right answer... 5 for this answer :)
Rajesh Anuhya 18-Mar-11 1:04am    
How it's down voted.., This is the correct answer for this type of lazy questions

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