asp.net - How to subtract a month from Date object? -


How do I want to reduce the date object in VB.NET to one month?

I have tried:

  today. However, today it is given that 01-January 2010, the result will be available to me 01-Dec-2010. I want the answer is 01-December-2009.  

Is this an easy way to do this? Net framework?

You really need to transport in a variable today and that assignment should work there. The following code will produce the results you expected (I just verify it because your post thought me twice).

  dim dt as dateTime = date.Today dt = dt.AddMonths (-2) String = DT. ToString ()  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -