Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Globalization.​DateTimeFormatInfo
Assembly: System.Runtime
Inheritance: object → DateTimeFormatInfo
Provides culture-specific information about the format of date and time values.
Properties
public
string[]
AbbreviatedDayNames
Gets or sets a one-dimensional array of type <see cref="T:System.String" /> containing the culture-specific abbreviated names of the days of the week.
public
string[]
AbbreviatedMonthGenitiveNames
Gets or sets a string array of abbreviated month names associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
string[]
AbbreviatedMonthNames
Gets or sets a one-dimensional string array that contains the culture-specific abbreviated names of the months.
public
string
AMDesignator
Gets or sets the string designator for hours that are "ante meridiem" (before noon).
public
Calendar
Calendar
Gets or sets the calendar to use for the current culture.
public
CalendarWeekRule
CalendarWeekRule
Gets or sets a value that specifies which rule is used to determine the first calendar week of the year.
public
string
DateSeparator
Gets or sets the string that separates the components of a date, that is, the year, month, and day.
public
string[]
DayNames
Gets or sets a one-dimensional string array that contains the culture-specific full names of the days of the week.
public
DayOfWeek
FirstDayOfWeek
Gets or sets the first day of the week.
public
string
FullDateTimePattern
Gets or sets the custom format string for a long date and long time value.
public
bool
IsReadOnly
Gets a value indicating whether the <see cref="T:System.Globalization.DateTimeFormatInfo" /> object is read-only.
public
string
LongDatePattern
Gets or sets the custom format string for a long date value.
public
string
LongTimePattern
Gets or sets the custom format string for a long time value.
public
string
MonthDayPattern
Gets or sets the custom format string for a month and day value.
public
string[]
MonthGenitiveNames
Gets or sets a string array of month names associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
string[]
MonthNames
Gets or sets a one-dimensional array of type <see cref="T:System.String" /> containing the culture-specific full names of the months.
public
string
NativeCalendarName
Gets the native name of the calendar associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
string
PMDesignator
Gets or sets the string designator for hours that are "post meridiem" (after noon).
public
string
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
ShortDatePattern
Gets or sets the custom format string for a short date value.
public
string[]
ShortestDayNames
Gets or sets a string array of the shortest abbreviated day names associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
string
ShortTimePattern
Gets or sets the custom format string for a short time value.
public
string
SortableDateTimePattern
Gets the custom format string for a sortable date and time value.
public
string
TimeSeparator
Gets or sets the string that separates the components of time, that is, the hour, minutes, and seconds.
public
string
UniversalSortableDateTimePattern
Gets the custom format string for a universal, sortable date and time string, as defined by ISO 8601.
public
string
YearMonthPattern
Gets or sets the custom format string for a year and month value.
Methods
public
object
Clone​() Returns A new <see cref="T:System.Globalization.DateTimeFormatInfo" /> object copied from the original <see cref="T:System.Globalization.DateTimeFormatInfo" /> .
Creates a shallow copy of the <see cref="T:System.Globalization.DateTimeFormatInfo" /> .
public
string
GetAbbreviatedDayName​(DayOfWeek dayofweek)
dayofweek
A <see cref="T:System.DayOfWeek" /> value.
Returns The culture-specific abbreviated name of the day of the week represented by <paramref name="dayofweek" /> .
Returns the culture-specific abbreviated name of the specified day of the week based on the culture associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
string
GetAbbreviatedEraName​(int era)
era
The integer representing the era.
Returns A string containing the abbreviated name of the specified era, if an abbreviation exists.
-or-
A string containing the full name of the era, if an abbreviation does not exist.
Returns the string containing the abbreviated name of the specified era, if an abbreviation exists.
public
string
GetAbbreviatedMonthName​(int month)
month
An integer from 1 through 13 representing the name of the month to retrieve.
Returns The culture-specific abbreviated name of the month represented by <paramref name="month" /> .
Returns the culture-specific abbreviated name of the specified month based on the culture associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
string[]
GetAllDateTimePatterns​() Returns An array that contains the standard patterns in which date and time values can be formatted.
Returns all the standard patterns in which date and time values can be formatted.
public
string[]
GetAllDateTimePatterns​(char format)
format
A standard format string.
Returns An array containing the standard patterns in which date and time values can be formatted using the specified format string.
Returns all the patterns in which date and time values can be formatted using the specified standard format string.
public
string
GetDayName​(DayOfWeek dayofweek)
dayofweek
A <see cref="T:System.DayOfWeek" /> value.
Returns The culture-specific full name of the day of the week represented by <paramref name="dayofweek" /> .
Returns the culture-specific full name of the specified day of the week based on the culture associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
int
GetEra​(string eraName)
eraName
The string containing the name of the era.
Returns The integer representing the era, if <paramref name="eraName" /> is valid; otherwise, -1.
Returns the integer representing the specified era.
public
string
GetEraName​(int era)
era
The integer representing the era.
Returns A string containing the name of the era.
Returns the string containing the name of the specified era.
public
object
GetFormat​(Type formatType)
formatType
The type of the required formatting service.
Returns The current object, if <paramref name="formatType" /> is the same as the type of the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> ; otherwise, <see langword="null" /> .
Returns an object of the specified type that provides a date and time formatting service.
public
string
GetMonthName​(int month)
month
An integer from 1 through 13 representing the name of the month to retrieve.
Returns The culture-specific full name of the month represented by <paramref name="month" /> .
Returns the culture-specific full name of the specified month based on the culture associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
string
GetShortestDayName​(DayOfWeek dayOfWeek)
dayOfWeek
One of the <see cref="T:System.DayOfWeek" /> values.
Returns The abbreviated name of the week that corresponds to the <paramref name="dayOfWeek" /> parameter.
Obtains the shortest abbreviated day name for a specified day of the week associated with the current <see cref="T:System.Globalization.DateTimeFormatInfo" /> object.
public
void
SetAllDateTimePatterns​(string[] patterns,
char format)
patterns
An array of custom format strings.
format
The standard format string associated with the custom format strings specified in the <paramref name="patterns" /> parameter.
Sets the custom date and time format strings that correspond to a specified standard format string.
public
bool
Equals​(object obj)
Inherited from object
obj
The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Returns A hash code for the current object.
Serves as the default hash function.
public
Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns A string that represents the current object.
Returns a string that represents the current object.