-
ASP.net Get Previous Month
I'm new to .Net and I am trying to get the first 3 characters of last month with the 2 digit year concatenated eg AUG07
I can get the month and year for the current month but i somehow need to subtract a month from it:
Dim MonthYear As String = DateTime.Now.ToString("MMMyy")
Any ideas? Your help is appreciated!
-
DateTime.Now.AddMonths(-1).ToString("MMMyy")
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks