C# DateTime Month
Description
DateTime Month
gets the month component of the date represented
by this instance.
Syntax
DateTime.Month
has the following syntax.
public int Month { get; }
Example
The following example demonstrates the Month property.
using System;/*w w w . ja va 2 s. c o m*/
public class MainClass{
public static void Main(String[] argv){
System.DateTime moment = new System.DateTime(
1999, 1, 13, 3, 57, 32, 11);
int month = moment.Month;
System.Console.WriteLine(month);
}
}
The code above generates the following result.