Completely Free .NET word API

Resources » Code Snippets » Date & Time

To get the previous Month

Updated: Category: Date & Time
Author: Member Level: SilverPoints: 4

C# Code :

DateTime LastMonthDate=DateTime.Now.AddMonths(-1);
Response.Write(LastMonthDate.ToString("MM/dd/yyyy")); Code:


if the current date is 10/22/2008 , then the output of the above code is 09/22/2008

Did you like this resource? Share it with your friends and show your love!

Responses to "To get the previous Month"

No responses found. Be the first to respond...


Post Comment:

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)

    Type the numbers and letters shown on the left.

    Submit Article     Return to Article Index
    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    Edi Purnomo
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India