DateTime.GetDateTimeFormats 方法

定義

將這個執行個體的值轉換為標準日期和時間格式規範所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the standard date and time format specifiers.

多載

GetDateTimeFormats()

將這個執行個體的值轉換為標準日期和時間格式規範所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the standard date and time format specifiers.

GetDateTimeFormats(Char)

將這個執行個體的值轉換為指定的標準日期和時間格式規範所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier.

GetDateTimeFormats(IFormatProvider)

將這個執行個體的值轉換為標準日期和時間格式規範和指定的特定文化特性格式資訊所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the standard date and time format specifiers and the specified culture-specific formatting information.

GetDateTimeFormats(Char, IFormatProvider)

將這個執行個體的值轉換為指定的標準日期和時間格式規範和特定文化特性格式資訊所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier and culture-specific formatting information.

備註

重要

您不應該假設多次呼叫 GetDateTimeFormats 多載會傳回相同的資料。You should not assume that multiple calls to the GetDateTimeFormats overloads will return identical data. 根據特定的多載,這個方法所傳回的資料可能會在目前的文化特性變更時變更、使用者覆寫個別的文化設定,或對系統的文化特性資料進行更新。Depending on the specific overload, the data returned by this method can change if the current culture changes, the user overrides individual cultural settings, or an update occurs to the system's cultural data.

GetDateTimeFormats()

將這個執行個體的值轉換為標準日期和時間格式規範所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the standard date and time format specifiers.

public:
 cli::array <System::String ^> ^ GetDateTimeFormats();
public string[] GetDateTimeFormats ();
member this.GetDateTimeFormats : unit -> string[]
Public Function GetDateTimeFormats () As String()

傳回

String[]

字串陣列,其中的每個元素都是這個執行個體的值使用其中一個標準日期和時間格式規範所格式化的表示。A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers.

範例

下列範例示範 DateTime.GetDateTimeFormats() 方法。The following example demonstrates the DateTime.GetDateTimeFormats() method. 它會使用電腦目前文化特性中的所有可能標準日期和時間格式來顯示日期的字串表示,在此案例中為 en-us。It displays the string representation of a date using all possible standard date and time formats in the computer's current culture, which in this case is en-US.

DateTime july28 = DateTime(2009, 7, 28, 5, 23, 15, 16);
array<String^>^july28Formats = july28.GetDateTimeFormats();

// Print [Out] july28* in all DateTime formats using the default culture.
System::Collections::IEnumerator^ myEnum = july28Formats->GetEnumerator();
while ( myEnum->MoveNext() )
{
   String^ format = safe_cast<String^>(myEnum->Current);
   System::Console::WriteLine( format );
}
DateTime july28 = new DateTime(2009, 7, 28, 5, 23, 15, 16);

string[] july28Formats = july28.GetDateTimeFormats();

// Print out july28 in all DateTime formats using the default culture.
foreach (string format in july28Formats) {
    Console.WriteLine(format);
}
Dim july28 As New DateTime(2009, 7, 28, 5, 23, 15, 16)
Dim july28Formats As String()
july28Formats = july28.GetDateTimeFormats()

' Print out july28 in all DateTime formats using the default culture.
For Each format As String In july28Formats
   Console.WriteLine(format)
Next

此範例會顯示下列輸出:The example displays the following output:

7/28/2009  
7/28/09  
07/28/09  
07/28/2009  
09/07/28  
2009-07-28  
28-Jul-09  
Tuesday, July 28, 2009  
July 28, 2009  
Tuesday, 28 July, 2009  
28 July, 2009  
Tuesday, July 28, 2009 5:23 AM  
Tuesday, July 28, 2009 05:23 AM  
Tuesday, July 28, 2009 5:23  
Tuesday, July 28, 2009 05:23  
July 28, 2009 5:23 AM  
July 28, 2009 05:23 AM  
July 28, 2009 5:23  
July 28, 2009 05:23  
Tuesday, 28 July, 2009 5:23 AM  
Tuesday, 28 July, 2009 05:23 AM  
Tuesday, 28 July, 2009 5:23  
Tuesday, 28 July, 2009 05:23  
28 July, 2009 5:23 AM  
28 July, 2009 05:23 AM  
28 July, 2009 5:23  
28 July, 2009 05:23  
Tuesday, July 28, 2009 5:23:15 AM  
Tuesday, July 28, 2009 05:23:15 AM  
Tuesday, July 28, 2009 5:23:15  
Tuesday, July 28, 2009 05:23:15  
July 28, 2009 5:23:15 AM  
July 28, 2009 05:23:15 AM  
July 28, 2009 5:23:15  
July 28, 2009 05:23:15  
Tuesday, 28 July, 2009 5:23:15 AM  
Tuesday, 28 July, 2009 05:23:15 AM  
Tuesday, 28 July, 2009 5:23:15  
Tuesday, 28 July, 2009 05:23:15  
28 July, 2009 5:23:15 AM  
28 July, 2009 05:23:15 AM  
28 July, 2009 5:23:15  
28 July, 2009 05:23:15  
7/28/2009 5:23 AM  
7/28/2009 05:23 AM  
7/28/2009 5:23  
7/28/2009 05:23  
7/28/09 5:23 AM  
7/28/09 05:23 AM  
7/28/09 5:23  
7/28/09 05:23  
07/28/09 5:23 AM  
07/28/09 05:23 AM  
07/28/09 5:23  
07/28/09 05:23  
07/28/2009 5:23 AM  
07/28/2009 05:23 AM  
07/28/2009 5:23  
07/28/2009 05:23  
09/07/28 5:23 AM  
09/07/28 05:23 AM  
09/07/28 5:23  
09/07/28 05:23  
2009-07-28 5:23 AM  
2009-07-28 05:23 AM  
2009-07-28 5:23  
2009-07-28 05:23  
28-Jul-09 5:23 AM  
28-Jul-09 05:23 AM  
28-Jul-09 5:23  
28-Jul-09 05:23  
7/28/2009 5:23:15 AM  
7/28/2009 05:23:15 AM  
7/28/2009 5:23:15  
7/28/2009 05:23:15  
7/28/09 5:23:15 AM  
7/28/09 05:23:15 AM  
7/28/09 5:23:15  
7/28/09 05:23:15  
07/28/09 5:23:15 AM  
07/28/09 05:23:15 AM  
07/28/09 5:23:15  
07/28/09 05:23:15  
07/28/2009 5:23:15 AM  
07/28/2009 05:23:15 AM  
07/28/2009 5:23:15  
07/28/2009 05:23:15  
09/07/28 5:23:15 AM  
09/07/28 05:23:15 AM  
09/07/28 5:23:15  
09/07/28 05:23:15  
2009-07-28 5:23:15 AM  
2009-07-28 05:23:15 AM  
2009-07-28 5:23:15  
2009-07-28 05:23:15  
28-Jul-09 5:23:15 AM  
28-Jul-09 05:23:15 AM  
28-Jul-09 5:23:15  
28-Jul-09 05:23:15  
July 28  
July 28  
2009-07-28T05:23:15.0160000  
2009-07-28T05:23:15.0160000  
Tue, 28 Jul 2009 05:23:15 GMT  
Tue, 28 Jul 2009 05:23:15 GMT  
2009-07-28T05:23:15  
5:23 AM  
05:23 AM  
5:23  
05:23  
5:23:15 AM  
05:23:15 AM  
5:23:15  
05:23:15  
2009-07-28 05:23:15Z  
Tuesday, July 28, 2009 12:23:15 PM  
Tuesday, July 28, 2009 12:23:15 PM  
Tuesday, July 28, 2009 12:23:15  
Tuesday, July 28, 2009 12:23:15  
July 28, 2009 12:23:15 PM  
July 28, 2009 12:23:15 PM  
July 28, 2009 12:23:15  
July 28, 2009 12:23:15  
Tuesday, 28 July, 2009 12:23:15 PM  
Tuesday, 28 July, 2009 12:23:15 PM  
Tuesday, 28 July, 2009 12:23:15  
Tuesday, 28 July, 2009 12:23:15  
28 July, 2009 12:23:15 PM  
28 July, 2009 12:23:15 PM  
28 July, 2009 12:23:15  
28 July, 2009 12:23:15  
July, 2009  
July, 2009  

備註

DateTime.GetDateTimeFormats() 方法所傳回的字串陣列,相當於將個別 DateTime.GetDateTimeFormats(Char) 呼叫所傳回的字串陣列,和 "d"、"D"、"f"、"F"、"g"、"G"、"m"、"o"、"r"、"s"、"t"、"T"、"u"、"U" 和 "y" 標準格式字串。The string array returned by the DateTime.GetDateTimeFormats() method is equivalent to combining the string arrays returned by separate calls to the DateTime.GetDateTimeFormats(Char) method with the "d", "D", "f", "F", "g", "G", "m", "o", "r", "s", "t", "T", "u", "U", and "y" standard format strings. 如需標準格式規範的詳細資訊,請參閱標準日期和時間格式字串For more information about standard format specifiers, see Standard Date and Time Format Strings.

傳回值的每個專案都會使用目前文化特性的資訊來格式化。Each element of the return value is formatted using information from the current culture. 如需目前文化特性的特定文化特性格式資訊的詳細資訊,請參閱 CultureInfo.CurrentCultureFor more information about culture-specific formatting information for the current culture, see CultureInfo.CurrentCulture.

重要

因為這個方法會使用區分文化特性的資料,所以您不應該假設多個方法呼叫將會傳回相同的資料。Because this method uses culture-sensitive data, you should not assume that multiple calls to the method will return identical data. 如果目前的文化特性變更、使用者覆寫個別的文化設定,或對系統的文化資料進行更新,這個方法所傳回的資料可能會變更。The data returned by this method can change if the current culture changes, the user overrides individual cultural settings, or an update occurs to the system's cultural data.

另請參閱

GetDateTimeFormats(Char)

將這個執行個體的值轉換為指定的標準日期和時間格式規範所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier.

public:
 cli::array <System::String ^> ^ GetDateTimeFormats(char format);
public string[] GetDateTimeFormats (char format);
member this.GetDateTimeFormats : char -> string[]
Public Function GetDateTimeFormats (format As Char) As String()

參數

format
Char

標準日期和時間格式字串。A standard date and time format string.

傳回

String[]

字串陣列,其中的每個項目都是這個執行個體的值使用 format 標準日期和時間格式規範所格式化的表示。A string array where each element is the representation of the value of this instance formatted with the format standard date and time format specifier.

例外狀況

format 不是有效的標準日期和時間格式規範字元。format is not a valid standard date and time format specifier character.

範例

下列範例示範 GetDateTimeFormats(Char) 方法。The following example demonstrates the GetDateTimeFormats(Char) method. 它會使用目前文化特性的完整日期格式規範("D")來顯示日期的字串表示。It displays the string representation of a date using the long date format specifier ("D") for the current culture.

  DateTime july28 = new DateTime(2009, 7, 28, 5, 23, 15);
  
  // Get the long date formats using the current culture.
  string [] longJuly28Formats = 
              july28.GetDateTimeFormats('D');

  // Display july28 in all long date formats.
  foreach (string format in longJuly28Formats) {
      Console.WriteLine(format);
  }
// The example displays the following output:
//       Tuesday, July 28, 2009
//       July 28, 2009
//       Tuesday, 28 July, 2009
//       28 July, 2009
  Dim july28 As Date = #7/28/2009 5:23:15#
  
  ' Get the long date formats using the current culture.
  Dim longJuly28Formats() As String = july28.GetDateTimeFormats("D"c)

  ' Display july28 in all long date formats.
  For Each format As String In longJuly28Formats
      Console.WriteLine(format)
Next			
' The example displays the following output:
'       Tuesday, July 28, 2009
'       July 28, 2009
'       Tuesday, 28 July, 2009
'       28 July, 2009

備註

format 參數可以是任何標準日期和時間格式規範。The format parameter can be any of the standard date and time format specifiers. 這些包括 d、D、f、F、g、G、M (或 M)、O (或 o)、R (或 r)、s、t、T、u、U 和 Y (或 y)。These include d, D, f, F, g, G, M (or m), O (or o), R (or r), s, t, T, u, U, and Y (or y). 如需詳細資訊,請參閱標準日期和時間格式字串For more information, see Standard Date and Time Format Strings.

傳回值的每個專案都會使用目前文化特性的資訊來格式化。Each element of the return value is formatted using information from the current culture. 如需目前文化特性的特定文化特性格式資訊的詳細資訊,請參閱 CultureInfo.CurrentCultureFor more information about culture-specific formatting information for the current culture, see CultureInfo.CurrentCulture.

重要

因為這個方法會使用區分文化特性的資料,所以您不應該假設多個方法呼叫將會傳回相同的資料。Because this method uses culture-sensitive data, you should not assume that multiple calls to the method will return identical data. 如果目前的文化特性變更、使用者覆寫個別的文化設定,或對系統的文化資料進行更新,這個方法所傳回的資料可能會變更。The data returned by this method can change if the current culture changes, the user overrides individual cultural settings, or an update occurs to the system's cultural data.

另請參閱

GetDateTimeFormats(IFormatProvider)

將這個執行個體的值轉換為標準日期和時間格式規範和指定的特定文化特性格式資訊所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the standard date and time format specifiers and the specified culture-specific formatting information.

public:
 cli::array <System::String ^> ^ GetDateTimeFormats(IFormatProvider ^ provider);
public string[] GetDateTimeFormats (IFormatProvider provider);
member this.GetDateTimeFormats : IFormatProvider -> string[]
Public Function GetDateTimeFormats (provider As IFormatProvider) As String()

參數

provider
IFormatProvider

物件,提供關於這個執行個體的文化特性格式資訊。An object that supplies culture-specific formatting information about this instance.

傳回

String[]

字串陣列,其中的每個元素都是這個執行個體的值使用其中一個標準日期和時間格式規範所格式化的表示。A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers.

範例

下列範例示範 DateTime.GetDateTimeFormats(IFormatProvider) 方法。The following example demonstrates the DateTime.GetDateTimeFormats(IFormatProvider) method. 它會使用 fr-fr 文化特性的所有可能標準日期和時間格式來顯示日期的字串表示。It displays the string representation of a date using all possible standard date and time formats for the fr-FR culture.

DateTime juil28 = DateTime(2009, 7, 28, 5, 23, 15, 16);
IFormatProvider^ culture = gcnew System::Globalization::CultureInfo("fr-FR", true );

// Get the short date formats using the S"fr-FR" culture.
array<String^>^frenchJuly28Formats = juil28.GetDateTimeFormats(culture );

// Print [Out] july28* in all DateTime formats using fr-FR culture.
System::Collections::IEnumerator^ myEnum2 = frenchJuly28Formats->GetEnumerator();
while ( myEnum2->MoveNext() )
{
   String^ format = safe_cast<String^>(myEnum2->Current);
   System::Console::WriteLine(format );
}
DateTime july28 = new DateTime(2009, 7, 28, 5, 23, 15, 16);

IFormatProvider culture = 
    new System.Globalization.CultureInfo("fr-FR", true);
// Get the short date formats using the "fr-FR" culture.
string [] frenchJuly28Formats = 
            july28.GetDateTimeFormats(culture);

// Display july28 in various formats using "fr-FR" culture.
foreach (string format in frenchJuly28Formats) {
    Console.WriteLine(format);
}
Dim july28 As New DateTime(2009, 7, 28, 5, 23, 15, 16)
Dim culture As New System.Globalization.CultureInfo("fr-FR", True)

Dim july28Formats As String()
' Get the short date formats using the "fr-FR" culture.
july28Formats = july28.GetDateTimeFormats(culture)

' Print out july28 in various formats using "fr-FR" culture.
For Each format As String In july28Formats
   Console.WriteLine(format)
Next 

此範例會顯示下列輸出:The example displays the following output:

28/07/2009  
28/07/09  
28.07.09  
28-07-09  
2009-07-28  
mardi 28 juillet 2009  
28 juil. 09  
28 juillet 2009  
mardi 28 juillet 2009 05:23  
mardi 28 juillet 2009 5:23  
mardi 28 juillet 2009 05.23  
mardi 28 juillet 2009 05 h 23  
28 juil. 09 05:23  
28 juil. 09 5:23  
28 juil. 09 05.23  
28 juil. 09 05 h 23  
28 juillet 2009 05:23  
28 juillet 2009 5:23  
28 juillet 2009 05.23  
28 juillet 2009 05 h 23  
mardi 28 juillet 2009 05:23:15  
mardi 28 juillet 2009 5:23:15  
mardi 28 juillet 2009 05.23  
mardi 28 juillet 2009 05 h 23  
28 juil. 09 05:23:15  
28 juil. 09 5:23:15  
28 juil. 09 05.23  
28 juil. 09 05 h 23  
28 juillet 2009 05:23:15  
28 juillet 2009 5:23:15  
28 juillet 2009 05.23  
28 juillet 2009 05 h 23  
28/07/2009 05:23  
28/07/2009 5:23  
28/07/2009 05.23  
28/07/2009 05 h 23  
28/07/09 05:23  
28/07/09 5:23  
28/07/09 05.23  
28/07/09 05 h 23  
28.07.09 05:23  
28.07.09 5:23  
28.07.09 05.23  
28.07.09 05 h 23  
28-07-09 05:23  
28-07-09 5:23  
28-07-09 05.23  
28-07-09 05 h 23  
2009-07-28 05:23  
2009-07-28 5:23  
2009-07-28 05.23  
2009-07-28 05 h 23  
28/07/2009 05:23:15  
28/07/2009 5:23:15  
28/07/2009 05.23  
28/07/2009 05 h 23  
28/07/09 05:23:15  
28/07/09 5:23:15  
28/07/09 05.23  
28/07/09 05 h 23  
28.07.09 05:23:15  
28.07.09 5:23:15  
28.07.09 05.23  
28.07.09 05 h 23  
28-07-09 05:23:15  
28-07-09 5:23:15  
28-07-09 05.23  
28-07-09 05 h 23  
2009-07-28 05:23:15  
2009-07-28 5:23:15  
2009-07-28 05.23  
2009-07-28 05 h 23  
28 juillet  
28 juillet  
2009-07-28T05:23:15.0160000  
2009-07-28T05:23:15.0160000  
Tue, 28 Jul 2009 05:23:15 GMT  
Tue, 28 Jul 2009 05:23:15 GMT  
2009-07-28T05:23:15  
05:23  
5:23  
05.23  
05 h 23  
05:23:15  
5:23:15  
05.23  
05 h 23  
2009-07-28 05:23:15Z  
mardi 28 juillet 2009 12:23:15  
mardi 28 juillet 2009 12:23:15  
mardi 28 juillet 2009 12.23  
mardi 28 juillet 2009 12 h 23  
28 juil. 09 12:23:15  
28 juil. 09 12:23:15  
28 juil. 09 12.23  
28 juil. 09 12 h 23  
28 juillet 2009 12:23:15  
28 juillet 2009 12:23:15  
28 juillet 2009 12.23  
28 juillet 2009 12 h 23  
juillet 2009  
juillet 2009  

備註

DateTime.GetDateTimeFormats(IFormatProvider) 方法所傳回的字串陣列,相當於將個別 DateTime.GetDateTimeFormats(Char, IFormatProvider) 呼叫所傳回的字串陣列,和 "d"、"D"、"f"、"F"、"g"、"G"、"m"、"o"、"r"、"s"、"t"、"T"、"u"、"U" 和 "y" 標準格式字串。The string array returned by the DateTime.GetDateTimeFormats(IFormatProvider) method is equivalent to combining the string arrays returned by separate calls to the DateTime.GetDateTimeFormats(Char, IFormatProvider) method with the "d", "D", "f", "F", "g", "G", "m", "o", "r", "s", "t", "T", "u", "U", and "y" standard format strings. 如需標準格式規範的詳細資訊,請參閱標準日期和時間格式字串For more information about standard format specifiers, see Standard Date and Time Format Strings.

傳回值的每個專案都是使用 provider所提供的文化特性(culture)特定資訊來格式化。Each element of the return value is formatted using culture-specific information supplied by provider.

重要

因為這個方法會使用區分文化特性的資料,所以您不應該假設多個方法呼叫將會傳回相同的資料,除非 provider 是代表不因文化特性而異的 CultureInfo 物件。Because this method uses culture-sensitive data, you should not assume that multiple calls to the method will return identical data unless provider is a CultureInfo object that represents the invariant culture. 如果使用者覆寫 provider 的個別文化特性設定,或如果系統的文化特性資料有 provider的更新,這個方法所傳回的資料就會變更。The data returned by this method can change if the user overrides the individual cultural settings of provider or if an update occurs to the system's cultural data for provider.

另請參閱

GetDateTimeFormats(Char, IFormatProvider)

將這個執行個體的值轉換為指定的標準日期和時間格式規範和特定文化特性格式資訊所支援的所有字串表示。Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier and culture-specific formatting information.

public:
 cli::array <System::String ^> ^ GetDateTimeFormats(char format, IFormatProvider ^ provider);
public string[] GetDateTimeFormats (char format, IFormatProvider provider);
member this.GetDateTimeFormats : char * IFormatProvider -> string[]
Public Function GetDateTimeFormats (format As Char, provider As IFormatProvider) As String()

參數

format
Char

日期和時間格式字串。A date and time format string.

provider
IFormatProvider

物件,提供關於這個執行個體的文化特性格式資訊。An object that supplies culture-specific formatting information about this instance.

傳回

String[]

字串陣列,其中的每個元素都是這個執行個體的值使用其中一個標準日期和時間格式規範所格式化的表示。A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers.

例外狀況

format 不是有效的標準日期和時間格式規範字元。format is not a valid standard date and time format specifier character.

範例

下列範例示範 GetDateTimeFormats(Char, IFormatProvider) 方法。The following example demonstrates the GetDateTimeFormats(Char, IFormatProvider) method. 它會使用 fr-fr 文化特性的簡短日期格式規範("d")來顯示日期的字串表示。It displays the string representations of a date using the short date format specifier ("d") for the fr-FR culture.

  DateTime july28 = new DateTime(2009, 7, 28, 5, 23, 15);
  
  IFormatProvider culture = 
      new System.Globalization.CultureInfo("fr-FR", true);
  // Get the short date formats using the "fr-FR" culture.
  string [] frenchJuly28Formats = 
              july28.GetDateTimeFormats('d', culture);

  // Display july28 in short date formats using "fr-FR" culture.
  foreach (string format in frenchJuly28Formats) {
      Console.WriteLine(format);
  }
// The example displays the following output:
//       28/07/2009
//       28/07/09
//       28.07.09
//       28-07-09
//       2009-07-28
  Dim july28 As Date = #7/28/2009 5:23:15#
  
  Dim culture As IFormatProvider = New System.Globalization.CultureInfo("fr-FR", True)
  ' Get the short date formats using the "fr-FR" culture.
  Dim frenchJuly28Formats() As String = july28.GetDateTimeFormats("d"c, culture)

  ' Display july28 in short date formats using "fr-FR" culture.
  For Each format As String In frenchJuly28Formats
      Console.WriteLine(format)
  Next
' The example displays the following output:
'       28/07/2009
'       28/07/09
'       28.07.09
'       28-07-09
'       2009-07-28

備註

Format 參數可以是任何標準日期和時間格式規範。The format parameter can be any of the standard date and time format specifiers. 這些包括 d、D、f、F、g、G、M (或 M)、O (或 o)、R (或 r)、s、t、T、u、U 和 Y (或 y)。These include d, D, f, F, g, G, M (or m), O (or o), R (or r), s, t, T, u, U, and Y (or y). 如需詳細資訊,請參閱標準日期和時間格式字串For more information, see Standard Date and Time Format Strings.

傳回值的每個專案都是使用 provider所提供的文化特性(culture)特定資訊來格式化。Each element of the return value is formatted using culture-specific information supplied by provider.

重要

因為這個方法會使用區分文化特性的資料,所以您不應該假設多個方法呼叫將會傳回相同的資料,除非 provider 是代表不因文化特性而異的 CultureInfo 物件。Because this method uses culture-sensitive data, you should not assume that multiple calls to the method will return identical data unless provider is a CultureInfo object that represents the invariant culture. 如果使用者覆寫 provider 的個別文化特性設定,或如果系統的文化特性資料有 provider的更新,這個方法所傳回的資料就會變更。The data returned by this method can change if the user overrides the individual cultural settings of provider or if an update occurs to the system's cultural data for provider.

另請參閱

適用於