DateTimeFormatInfo

DateTimeFormatInfo CF 1.0, ECMA 1.0, serializable

System.Globalization (mscorlib.dll) sealed class

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  DateTimeFormatInfo  ( );  // Public Static Properties  public static DateTimeFormatInfo  CurrentInfo  {get; }    public static DateTimeFormatInfo  InvariantInfo  {get; }  // Public Instance Properties  public string[ ]  AbbreviatedDayNames  {set; get; }    public string[ ]  AbbreviatedMonthNames  {set; get; }    public string  AMDesignator  {set; get; }    public Calendar  Calendar  {set; get; }    public CalendarWeekRule  CalendarWeekRule  {set; get; }    public string  DateSeparator  {set; get; }    public string[ ]  DayNames  {set; get; }    public DayOfWeek  FirstDayOfWeek  {set; get; }    public string  FullDateTimePattern  {set; get; }    public bool  IsReadOnly  {get; }    public string  LongDatePattern  {set; get; }    public string  LongTimePattern  {set; get; }    public string  MonthDayPattern  {set; get; }    public string[ ]  MonthNames  {set; get; }    public string  PMDesignator  {set; get; }    public string  RFC1123Pattern  {get; }    public string  ShortDatePattern  {set; get; }    public string  ShortTimePattern  {set; get; }    public string  SortableDateTimePattern  {get; }    public string  TimeSeparator  {set; get; }    public string  UniversalSortableDateTimePattern  {get; }    public string  YearMonthPattern  {set; get; }  // Public Static Methods  public static DateTimeFormatInfo  GetInstance  (IFormatProvider   provider   );    public static DateTimeFormatInfo  ReadOnly  (DateTimeFormatInfo   dtfi   );  // Public Instance Methods  public object  Clone  ( );  // implements ICloneable  public string  GetAbbreviatedDayName  (DayOfWeek   dayofweek   );    public string  GetAbbreviatedEraName  (int   era   );    public string  GetAbbreviatedMonthName  (int   month   );    public string[ ]  GetAllDateTimePatterns  ( );    public string[ ]  GetAllDateTimePatterns  (char   format   );    public string  GetDayName  (DayOfWeek   dayofweek   );    public int  GetEra  (string   eraName   );    public string  GetEraName  (int   era   );    public object  GetFormat  (Type   formatType   );  // implements IFormatProvider  public string  GetMonthName  (int   month   ); } 

Returned By

CultureInfo.DateTimeFormat

Passed To

CultureInfo.DateTimeFormat



C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net