O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

DateTimeFormatInfo

Synopsis

This class defines how DateTime values are formatted for a culture. Several standard patterns are defined with the default property values. These standard patterns are designated by a format character. The format character provides a shortcut to specify the format of a DateTime with the ToString() method. You can create custom formats using a set of format pattern characters. These characters represent different styles of day and time representations and allow you to build customized pattern strings. To create custom patterns, first you need to construct a writable instance of DateTimeFormatInfo by using its constructor. Use InvariantInfo to fetch a culture-independent, read-only instance of this class.

public sealed class DateTimeFormatInfo : ICloneable, IFormatProvider {
// Public Constructors
   public method DateTimeFormatInfo();  
// Public Static Properties
   public static field DateTimeFormatInfo CurrentInfo{get; } 
   public static field DateTimeFormatInfo InvariantInfo{get; } 
// Public Instance Properties
   public field string[] AbbreviatedDayNames{set; get; } 
   public field string[] AbbreviatedMonthNames{set; get; } 
   public field string AMDesignator{set; get; } 
   public field Calendar Calendar{set; get; } 
   public field CalendarWeekRule CalendarWeekRule{set; get; } 
   public field string DateSeparator{set; get; } 
   public field string[] DayNames{set; get; } 
   public field DayOfWeek FirstDayOfWeek{set; get; } 
   public field string FullDateTimePattern{set; get; } public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required