DateTimeOffset format: MMM d, yyyy : DateTimeOffset Format « Date Time « C# / C Sharp






DateTimeOffset format: MMM d, yyyy

DateTimeOffset format: MMM d, yyyy
  


using System;
using System.Globalization;
public class Test
{
   public static void Main()
   {

        DateTimeOffset startOfMonth = new DateTimeOffset(2008, 1, 1, 0, 0, 0, DateTimeOffset.Now.Offset);
        int year = startOfMonth.Year;
        do 
        {
           Console.WriteLine("{0:MMM d, yyyy} is a {1}.", startOfMonth, startOfMonth.DayOfWeek);
           startOfMonth = startOfMonth.AddMonths(1);
        }
        while (startOfMonth.Year == year);
   }
}
/*
Jan 1, 2008 is a Tuesday.
Feb 1, 2008 is a Friday.
Mar 1, 2008 is a Saturday.
Apr 1, 2008 is a Tuesday.
May 1, 2008 is a Thursday.
Jun 1, 2008 is a Sunday.
Jul 1, 2008 is a Tuesday.
Aug 1, 2008 is a Friday.
Sep 1, 2008 is a Monday.
Oct 1, 2008 is a Wednesday.
Nov 1, 2008 is a Saturday.
Dec 1, 2008 is a Monday.

*/

   
    
  








Related examples in the same category

1.DateTimeOffset format: D (2)DateTimeOffset format: D (2)
2.DateTimeOffset format: dDateTimeOffset format: d
3.DateTimeOffset format: Y or yDateTimeOffset format: Y or y
4.DateTimeOffset custom format specifier: dd MMM yyyyDateTimeOffset custom format specifier: dd MMM yyyy
5.DateTimeOffset format: ddDateTimeOffset format: dd
6.DateTimeOffset format: ddddDateTimeOffset format: dddd
7.DateTimeOffset format: dddd and CultureInfo("fr-fr")DateTimeOffset format: dddd and CultureInfo(
8.DateTimeOffset format: mDateTimeOffset format: m
9.DateTimeOffset format: mm (2)DateTimeOffset format: mm (2)
10.DateTimeOffset format: M (3)DateTimeOffset format: M (3)
11.DateTimeOffset format: MMDateTimeOffset format: MM
12.DateTimeOffset format: t
13.DateTimeOffset format: T (2)
14.DateTimeOffset format: f
15.DateTimeOffset format: F (2)
16.DateTimeOffset format: g
17.DateTimeOffset format: G (2)
18.DateTimeOffset format: R
19.DateTimeOffset format: s
20.DateTimeOffset format: u
21.DateTimeOffset format: Y
22.DateTimeOffset format: y (2)
23.DateTimeOffset format: yy
24.DateTimeOffset format: yyyy
25.Converts string to DateTimeOffset using the specified format and culture-specific format information.Converts string to DateTimeOffset using the specified format and culture-specific format information.
26.Converts string to DateTimeOffset using the specified format, culture-specific format information, and style.Converts string to DateTimeOffset using the specified format, culture-specific format information, and style.
27.Converts string to DateTimeOffset using the specified formats, culture-specific format information, and style.Converts string to DateTimeOffset using the specified formats, culture-specific format information, and style.
28.Converts DateTimeOffset to string using the specified culture-specific formatting information.
29.Convert DateTimeOffset to string with different culture information
30.Converts DateTimeOffset to string using the specified format.
31.Converts DateTimeOffset to string using the specified format and culture-specific format information.
32.Output date using each standard date/time format specifier
33.Output date and time using custom format specification