[edit] C# DateTime Year Property
The DateTime Year property simply returns the year part of a datetime object which will be between 0001 and 9999.
[edit] Syntax
int month = variable.Month;
[edit] Example
using System;
class Program
{
static void Main()
{
DateTime date = DateTime.Now;
Console.WriteLine(date.Year);
Console.Read();
}
}
Output:
2007
<= DateTime Tutorial
|