C# DateTimeOffset DayOfWeek
Description
DateTimeOffset DayOfWeek
gets the day of the week represented
by the current DateTimeOffset object.
Syntax
DateTimeOffset.DayOfWeek
has the following syntax.
public DayOfWeek DayOfWeek { get; }
Example
The following example displays the weekday name of the first day of each month of the year 2014.
using System;// w ww . j av a2 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.