Mega Code Archive

 
Categories / C# / Date Time
 

Gets the day of the month from DateTimeOffset object

using System; public class Test {    public static void Main()    {         DateTimeOffset theTime = new DateTimeOffset(2010, 5, 2, 16, 35, 0, DateTimeOffset.Now.Offset);         Console.WriteLine("The day component of {0} is {1}.", theTime, theTime.Day);    } }