Get the day of the week represented by the current DateTimeOffset object in CSharp
Description
The following code shows how to get the day of the week represented by the current DateTimeOffset object.
Example
using System;/* w w w .j a v a 2 s .c om*/
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset startOfMonth = new DateTimeOffset(2014, 1, 1, 0, 0, 0,
DateTimeOffset.Now.Offset);
Console.WriteLine("{0:MMM d, yyyy} is a {1}.", startOfMonth, startOfMonth.DayOfWeek);
}
}
The code above generates the following result.