BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 This type is safe for multithreaded operations. System.Object System.ICloneable System.IFormatProvider

Defines culture-specific formats and patterns for values.

values are formatted by the and methods according to standard or custom patterns stored in the properties of a instance. The standard patterns can be accessed and modified through the associated properties. The format patterns and properties of a read-only instance cannot be changed. To determine whether a instance is read-only, use the property.

Date and time format patterns are specified using strings called . A string is interpreted as standard format specifier if it contains exactly one standard format specifier character. If the string contains a single character and that character is not one of the standard format specifiers, an exception is thrown. If the string contains two or more characters, even if the extra characters are white spaces, the string is interpreted as a custom format specifier. Format specifiers and format patterns are case-sensitive; for example, 'g' and 'G' represent different

patterns.

The following table shows the standard format specifiers and the associated format pattern defined for the invariant culture. The exact pattern produced by a format specifier is influenced by culture-specific date and/or time settings on the current system; computers with different date and time settings might display different patterns. The asterisk at the end of a format pattern indicates that the preceding character can be repeated without changing the meaning of the pattern. For example, the pattern "HH*" indicates that the strings "HH", "HHH", "HHHH", and "HHHHH" produce the same result when used with and methods.

Format Specifier
Format Pattern Description
d
MM/dd/yyyy The full date in numeric format ( ).
D
dddd*, dd MMMM* yyyy The full date including the day of the week and the name of the month ( ).
f
dddd*, dd MMMM* yyyy HH*:mm* The full date and time, including the day of the week and the name of the month ( combined with ).
F
dddd*, dd MMMM* yyyy HH*:mm*:ss* The full date and time, including the seconds ( equivalent to combined with ).
g
MM/dd/yyyy HH*:mm* A general date pattern including the short time form ( combined with ).
G
MM/dd/yyyy HH*:mm*:ss* A general date pattern including the long time form ( combined with ).
m, M
MMMM* dd The full name of the month and the date ( ).
t
HH*:mm* The time in short format ( ).
T
HH*:mm*:ss* The time in long format ( ).
U
dddd*, dd MMMM* yyyy HH*:mm*:ss* The full date and time, including the seconds, in the Gregorian calendar ( ).
y, Y
yyyy MMMM* The full name of the month and the year in four-digit format ( ). The following table lists custom format specifiers that can be combined to construct custom patterns. If the custom pattern contains white space characters, characters enclosed in single or double quotation marks, or characters not defined in the following table, these characters are considered literals and are included in the output string unchanged. See the class for the list of white space characters.
Format Pattern
Description Examples
d
The day of the month as a value in the range 1-31, inclusive. Single-digit days do not have a leading zero.

1

22

dd
The day of the month as a value in the range 1-31, inclusive. Single-digit days have a leading zero.

01

22

ddd
The abbreviated name of the day of the week, as defined in .Mon
dddd*
The full name of the day of the week, as defined in .Monday
M
The numeric month as a value in the range 1-12, inclusive. Single-digit months do not have a leading zero.

2

11

MM
The numeric month as a value in the range 1-12, inclusive. Single-digit months have a leading zero.

02

11

MMM
The abbreviated name of the month, as defined in .Feb
MMMM*
The full name of the month, as defined in .February
y
The year without the century (two-digit). If the value is less than 10, the year is displayed with no leading zero.

0

3

yy
The year without the century (two-digit). If the year without the century is less than 10, the year is displayed with a leading zero.

00

03

yyyy
The year including the century in four digits.

2000

2003

g*
The name of a period or era (such as "A.D." or "B.C."). This pattern is ignored if the date to be formatted does not have an associated period or era string.A.D.
h
The hour within a 12-hour range as a value in the range 1-12, inclusive. Single-digit hours do not have a leading zero. The value represents whole hours passed since either midnight (12) or noon (12). To distinguish between values occurring before and after noon, include the "t" or "tt*" custom format specifier.

3

11

hh*
The hour within a 12-hour range as a value in the range 1-12, inclusive. Single-digit hours have a leading zero. The value represents whole hours passed since either midnight (12) or noon (12). To distinguish between values occurring before and after noon, include the "t" or "tt*" custom format specifier.

03

11

H
The hour as a value in the range 0-23, inclusive. Single-digit hours do not have a leading zero. The value represents whole hours passed since midnight.

3

13

HH*
The hour as a value in the range 0 and 23, inclusive. Single-digit hours have a leading zero. The value represents whole hours passed since midnight.

03

13

m
The minute as a value in the range 0-59, inclusive. Single-digit minutes do not have a leading zero. The value represents whole minutes passed since the last hour.

5

15

mm*
The minute as a value in the range 0-59, inclusive. Single-digit minutes have a leading zero. The value represents whole minutes passed since the last hour.

05

15

s
The second as a value in the range 0-59, inclusive. Single-digit seconds do not have a leading zero. The value represents whole seconds passed since the last minute.

1

30

ss*
The second as a value in the range 0-59, inclusive. Single-digit seconds have a leading zero. The value represents whole seconds passed since the last minute.

01

30

f
Displays fractional seconds represented in one digit.1
ff
Displays fractional seconds represented in two digits.01
fff
Displays fractional seconds represented in three digits.001
ffff
Displays fractional seconds represented in four digits.0001
fffff
Displays fractional seconds represented in five digits.00001
ffffff
Displays fractional seconds represented in six digits.000001
fffffff
Displays fractional seconds represented in seven digits.0000001
t
The first character of the AM/PM designator defined in the property or . If the total number of hours passed since midnight is less than 12, the A.M. designator is used; otherwise the P.M. designator is used.

A

P

tt*
The AM/PM designator defined in the property or . If the total number of hours passed since midnight is less than 12, the A.M. designator is used; otherwise the P.M. designator is used.

AM

PM

z
The time zone offset (hour only) from the universal time coordinate (UTC) time (Greenwich Mean Time) as a value in the range -12 to +13, inclusive. Single-digit hours do not have a leading zero. The value always includes a leading sign (zero is '+0'), indicating hours ahead of UTC time (+) or hours behind UTC time (-). The offset takes Daylight Savings Time into account.-8
zz
The time zone offset (hour only) from the UTC time (Greenwich Mean Time) as a value in the range -12 to +13, inclusive. Single-digit hours have a leading zero. The value always includes a leading sign (zero is '+0'), indicating hours ahead of UTC time (+) or hours behind UTC time (-). The offset takes Daylight Savings Time into account.-08
zzz*
The full time zone offset (hour and minutes) from the UTC time (Greenwich Mean Time) as a value in the range -12:00 to +13:00, inclusive. Single-digit hours and minutes have leading zeros. The value always includes a leading sign (zero is '+0'), indicating hours ahead of UTC time (+) or hours behind UTC time (-). The offset takes Daylight Savings Time into account.-08:00
:
The invariant culture time separator defined in .:
/
The invariant culture date separator defined in the ./
represents a single custom format character. Produces the custom format pattern associated with the format character . The % specifier provides a mechanism for specifying a single custom format character and having it recognized as a custom specifier. This format is intended for characters that define both a custom and a standard format. Note that a format string containing exactly one such character will be interpreted as a standard format specifier unless prefaced with the %. For example, for the invariant culture, "%d" produces the single or double digit date, while "d" produces the date in "MM/dd/yyyy" format. Without the %, a format string containing one character would have to include leading or trailing white space to be interpreted as a custom specifier because custom formats are required to have two or more characters."%y" produces a two digit year without a leading zero, and not the "MMMM, yyyy" pattern.
represents any character predefined as part of a format specifier. Prevents the character from being interpreted as a format specifier (the character is treated as a literal). In programming languages where the backslash ('\') character is used to specify control sequences such as newline (\n), the backslash character is required to be specified twice. For example, in C#, "\d" is coded as "\\d"."\d" produces the character 'd', and not the day of the month.
'' or ""
represents a string of characters of any length. The characters are treated as literals."'d'" produces the character 'd', and not the day of the month.
- Constructor

  Constructs and initializes a new instance of the class that is culture-independent (invariant).

  The new instance of is not read-only, and its properties can be modified with user-defined patterns.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.String[]

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

  A one-dimensional array of type containing the culture-specific abbreviated names of the days of the week.

  The array specified in a set operation is required to be one-dimensional and have exactly seven elements. The first element of the array is the abbreviated day name for Sunday, and the last element is the name for Saturday.

  The property value of the culture invariant is a array that contains "Sun", "Mon", "Tue", "Wed", "Thu", "Fri" and "Sat".

  The value specified for a set operation is a null reference. The value specified for a set operation is not an array with exactly 7 elements. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String[] To be added. To be added. To be added. System.Runtime.InteropServices.ComVisible(false) 2.0.0.0 4.0.0.0
- Property
  System.String[]

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

  A one-dimensional array of type containing the abbreviated names of the months. For cultures with 12-month calendars the 13th element of the array is an empty string.

  The specified in a set operation is required to be one-dimensional and have exactly 13 elements.

  The property value of the culture invariant is a array that contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" and "".

  The array returned by this property has 13 elements to support calendars with 13 months.

  The value specified for a set operation is a null reference. The value specified for a set operation is not an array with exactly 13 elements. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the culture-specific designator for hours that are "ante meridiem" (before noon).

  The designator for hours that are before noon.

  The property value of the culture invariant returns the "AM".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.Globalization.Calendar To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.Globalization.CalendarWeekRule To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Object

  Creates a copy of the current instance.

  A new instance with property values equal to the property values of the original instance.

  The method creates a new instance of the same type as the current instance, and then copies the contents of each of the current instance's non-static fields.

  The new instance is not read-only, and its properties can be modified with user-defined patterns.

  This method is implemented to support the interface.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Globalization.DateTimeFormatInfo

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

  A read-only instance based on the culture of the current thread.

  This property is read-only.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.String

  Gets or sets the culture-specific to use to separate the year, month, and day components of a date.

  The to use to separate the year, month and day components of a date.

  The property value of the culture invariant is "/".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String[]

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

  A one-dimensional array of type containing the full names of the days of the week.

  The array specified in a set operation is required to be one-dimensional and have exactly seven elements. The first element of the array is the abbreviated day name for Sunday, and the last element is the name for Saturday.

  The property value of the culture invariant is a array that contains "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" and "Saturday".

  The value specified for a set operation is a null reference. The value specified for a set operation is not an array with exactly 7 elements. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.DayOfWeek To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the format pattern for a long date and long time value.

  A containing the format pattern for a long date and long time value.

  The and methods associate the format pattern returned by this property with the 'F' format character.

  The property value of the culture invariant is "dddd, dd MMMM yyyy HH:mm:ss".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` A from 1 through 13 representing the month name to retrieve.

  Gets the abbreviated name of the specified month based on the culture of the current thread.

  A containing the abbreviated name of the month represented by . For cultures with 12-month calendars, the empty string is returned as the name of the 13th month.

  For the default (culture-invariant) instance, this method returns one of the following strings:

  Return Value
  1
  "Jan"
  2
  "Feb"
  3
  "Mar"
  4
  "Apr"
  5
  "May"
  6
  "Jun"
  7
  "Jul"
  8
  "Aug"
  9
  "Sep"
  10
  "Oct"
  11
  "Nov"
  12
  "Dec"
  13
  ""

  This method supports calendars with 13 months.

  is less than 1 or greater than 13. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String[] To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String[] `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Int32 `` A containing the name of the era.

  Gets a representing the specified era.

  A representing the era. If is invalid, returns -1.

  The value specified for is case-insensitive.

  An era name is a culturally specific name for a period of time marked by distinctive characters or reckoned from a fixed point or event. For example "A.D." and "B.C." are two eras of the Gregorian calendar.

  is a null reference. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` A representing the era.

  Gets the containing the name of the specified era.

  A containing the name of the era.

  An era name is a culturally specific name for a period of time marked by distinctive characters or reckoned from a fixed point or event. For example "A.D." and "B.C." are two eras of the Gregorian calendar.

  does not represent a valid era in calendar for the current thread. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Object `` The of the formatting object to be returned.

  Returns an object of the specified type that provides formatting services.

  The current instance, if is of type ; otherwise, a null reference.

  This method is implemented to support the interface.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Globalization.DateTimeFormatInfo `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` A from 1 through 13 representing the month name to retrieve.

  Gets the full name of the specified month based on the culture of the current thread.

  A containing the full name of the month represented by . For cultures with 12-month calendars the empty string is returned as the name of the 13th month.

  For the default (culture invariant) instance, this method returns one of the following strings:

  Return Value
  1
  "January"
  2
  "February"
  3
  "March"
  4
  "April"
  5
  "May"
  6
  "June"
  7
  "July"
  8
  "August"
  9
  "September"
  10
  "October"
  11
  "November"
  12
  "December"
  13
  ""

  This method supports calendars with 13 months.

  is less than 1 or greater than 13. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.String `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0 System.Runtime.InteropServices.ComVisible(false)
- Property
  System.Globalization.DateTimeFormatInfo

  Gets a culture invariant instance of that is read-only.

  A read-only instance.

  This property is read-only.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.Boolean

  Gets a value indicating whether the current instance is read-only.

  if the is read-only; otherwise, .

  This property is read-only.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Property
  System.String

  Gets or sets the format pattern for a long date value.

  A containing the format pattern for a long date value.

  The and methods associate the format pattern returned by this property with the 'D' format character.

  The property value of the culture invariant is "dddd, dd MMMM yyyy".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the format pattern for a long time value.

  A containing the format pattern for a long time value.

  The and methods associate the format pattern returned by this property with the 'T' format character.

  The property value of the culture invariant is "HH:mm:ss".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the format pattern for a month and day value.

  A containing the format pattern for a month and day value.

  The and methods associate the format pattern returned by this property with the 'm' and 'M' format characters.

  The property value of the culture invariant is "MMMM dd".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String[] To be added. To be added. To be added. System.Runtime.InteropServices.ComVisible(false) 2.0.0.0 4.0.0.0
- Property
  System.String[]

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

  A one-dimensional array of type containing the full names of the months. For cultures with 12-month calendars the 13th element of the array is an empty string.

  The array specified in a set operation is required be one-dimensional and have exactly 13 elements.

  The property value of the culture invariant is a array that contains "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" and "".

  The array returned by this property has 13 elements to support calendars with 13 months.

  The value specified for a set operation is a null reference. The value specified for a set operation is not an array with exactly 13 elements. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String To be added. To be added. To be added. System.Runtime.InteropServices.ComVisible(false) 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the culture-specific designator for hours that are "post meridiem" (after noon).

  The designator for hours that are after noon.

  The property value of the culture invariant is "PM".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Globalization.DateTimeFormatInfo `` The to copy.

  Returns a read-only copy of the specified instance of .

  A read-only instance of that is a copy of .

  Use a read-only copy to prevent modifications to the specified instance.

  is a null reference. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0 System.Runtime.InteropServices.ComVisible(false)
- Property
  System.String

  Gets or sets the format pattern for a short date value.

  A containing the format pattern for a short date value.

  The and methods associate the format pattern returned by this property with the 'd' format character.

  The property value of the culture invariant is "MM/dd/yyyy".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.Runtime.InteropServices.ComVisible(false)
  System.String[] To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the format pattern for a short time value.

  A containing the format pattern for a short time value.

  The and methods associate the format pattern returned by this property with the 't' format character.

  The property value of the culture invariant is "HH:mm".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the culture-specific to use to separate the components of time values (hour, minutes, seconds).

  The to use to separate the components of time; that is, the hour, the minutes and the seconds.

  The property value of the culture invariant is ":".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Property
  System.String

  Gets or sets the format pattern for a year and month value.

  The format pattern for a year and month value.

  The and methods associate the format pattern returned by this property with the 'y' and 'Y' format character.

  The property value of the culture invariant is "yyyy MMMM".

  The value specified for a set operation is a null reference. The current instance is read-only and a set operation was attempted. 0 1.0.5000.0 2.0.0.0 4.0.0.0
0 System.Runtime.InteropServices.ComVisible(true)