Table of Contents

Class DateTimeFormatInfo

Namespace
System.Globalization
Assembly
mscorlib.dll

Provides culture-specific information about the format of date and time values.

public sealed class DateTimeFormatInfo
Inheritance
DateTimeFormatInfo
Inherited Members
Extension Methods

Properties

AMDesignator

Gets the string designator for hours that are "ante meridiem" (before noon).

public string AMDesignator { get; }

Property Value

string

The string designator for hours that are ante meridiem. The default for InvariantInfo is "AM".

AbbreviatedDayNames

Gets a one-dimensional array of type String containing the culture-specific abbreviated names of the days of the week.

public string[] AbbreviatedDayNames { get; }

Property Value

string[]

A one-dimensional array of type String containing the culture-specific abbreviated names of the days of the week. The array for InvariantInfo contains "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", and "Sat".

AbbreviatedMonthNames

Gets or sets a one-dimensional string array that contains the culture-specific abbreviated names of the months.

public string[] AbbreviatedMonthNames { get; }

Property Value

string[]

A one-dimensional string array with 13 elements that contains the culture-specific abbreviated names of the months. For 12-month calendars, the 13th element of the array is an empty string. The array for InvariantInfo contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", and "".

CurrentInfo

Gets a read-only DateTimeFormatInfo object that formats values based on the current culture.

public static DateTimeFormatInfo CurrentInfo { get; }

Property Value

DateTimeFormatInfo

A read-only DateTimeFormatInfo object based on the CultureInfo object for the current thread.

DateSeparator

Gets the string that separates the components of a date, that is, the year, month, and day.

public string DateSeparator { get; }

Property Value

string

The string that separates the components of a date, that is, the year, month, and day. The default for InvariantInfo is "/".

DayNames

Gets a one-dimensional string array that contains the culture-specific full names of the days of the week.

public string[] DayNames { get; }

Property Value

string[]

A one-dimensional string array that contains the culture-specific full names of the days of the week. The array for InvariantInfo contains "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday".

FullDateTimePattern

Gets the custom format string for a long date and long time value.

public string FullDateTimePattern { get; }

Property Value

string

The custom format string for a long date and long time value.

LongDatePattern

Gets the custom format string for a long date value.

public string LongDatePattern { get; }

Property Value

string

The custom format string for a long date value.

LongTimePattern

Gets the custom format string for a long time value.

public string LongTimePattern { get; }

Property Value

string

The format pattern for a long time value.

MonthDayPattern

Gets the custom format string for a month and day value.

public string MonthDayPattern { get; }

Property Value

string

The custom format string for a month and day value.

MonthNames

Gets or sets a one-dimensional array of type String containing the culture-specific full names of the months.

public string[] MonthNames { get; }

Property Value

string[]

A one-dimensional array of type String containing the culture-specific full names of the months. In a 12-month calendar, the 13th element of the array is an empty string. The array for InvariantInfo contains "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", and "".

PMDesignator

Gets the string designator for hours that are "post meridiem" (after noon).

public string PMDesignator { get; }

Property Value

string

The string designator for hours that are "post meridiem" (after noon). The default for InvariantInfo is "PM".

RFC1123Pattern

Gets the custom format string for a time value that is based on the Internet Engineering Task Force (IETF) Request for Comments (RFC) 1123 specification.

public string RFC1123Pattern { get; }

Property Value

string

The custom format string for a time value that is based on the IETF RFC 1123 specification.

ShortDatePattern

Gets the custom format string for a short date value.

public string ShortDatePattern { get; }

Property Value

string

The custom format string for a short date value.

ShortTimePattern

Gets the custom format string for a short time value.

public string ShortTimePattern { get; }

Property Value

string

The custom format string for a short time value.

SortableDateTimePattern

Gets the custom format string for a sortable date and time value.

public string SortableDateTimePattern { get; }

Property Value

string

The custom format string for a sortable date and time value.

TimeSeparator

Gets the string that separates the components of time, that is, the hour, minutes, and seconds.

public string TimeSeparator { get; }

Property Value

string

The string that separates the components of time. The default for InvariantInfo is ":".

UniversalSortableDateTimePattern

Gets the custom format string for a universal, sortable date and time string.

public string UniversalSortableDateTimePattern { get; }

Property Value

string

The custom format string for a universal, sortable date and time string.

YearMonthPattern

Gets the custom format string for a year and month value.

public string YearMonthPattern { get; }

Property Value

string

The custom format string for a year and month value.