none
How to get the Month number in c#

    Question

  • How to get the Month number in c#.

    i want to get get the number of month.

    example,

    January = 1,

    February = 2

    March = 3 and so on.

     

    thanks.


    Larrix
    Monday, August 15, 2011 12:59 AM

Answers

  • Hi,

          DateTime dt = DateTime.Now;
    
          MessageBox.Show(dt.Month.ToString());
    

    Regards,

      Thorsten

    • Marked as answer by Larrix Monday, August 15, 2011 1:18 AM
    Monday, August 15, 2011 1:09 AM

All replies