C# DateTimeOffset Day
Description
DateTimeOffset Day
gets the day of the month represented
by the current DateTimeOffset object.
Syntax
DateTimeOffset.Day
has the following syntax.
public int Day { get; }
Example
The following example displays the day component of a DateTimeOffset object in three different ways:
using System;/*from ww w. j a v a2 s . c o m*/
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset theTime = new DateTimeOffset(2014, 5, 1, 16, 35, 0,
DateTimeOffset.Now.Offset);
Console.WriteLine("The day component of {0} is {1}.",
theTime, theTime.Day);
}
}
The code above generates the following result.