DateTimeFormatInfo.InvariantInfo 屬性


取得與文化特性無關 (非變異) 的預設唯讀 DateTimeFormatInfo 物件。Gets the default read-only DateTimeFormatInfo object that is culture-independent (invariant).

 static property System::Globalization::DateTimeFormatInfo ^ InvariantInfo { System::Globalization::DateTimeFormatInfo ^ get(); };
public static System.Globalization.DateTimeFormatInfo InvariantInfo { get; }
member this.InvariantInfo : System.Globalization.DateTimeFormatInfo
Public Shared ReadOnly Property InvariantInfo As DateTimeFormatInfo


與文化特性無關 (非變異) 的唯讀物件。A read-only object that is culture-independent (invariant).


不論目前的文化特性為何,這個屬性都不會變更。This property does not change, regardless of the current culture. 因此,不因文化特性而異DateTimeFormatInfo的物件,可以用來產生一致、與文化特性無關的結果,以針對多重文化特性的資料進行剖析和格式化作業。Because of this, the invariant culture's DateTimeFormatInfo object can be used to produce consistent, culture-independent results in parsing and formatting operations on data that is multi-cultural. 例如,如果要以字串形式保存多個文化特性的日期和時間資料,可以使用DateTimeFormatInfo不因文化特性而異的物件來格式化,並加以儲存。For example, if date and time data from multiple cultures is to be persisted in string form, it can be formatted by using the DateTimeFormatInfo object of the invariant culture and saved. 然後可以使用不因文化特性而異的DateTimeFormatInfo物件來進行剖析。It can then be parsed by using the invariant culture's DateTimeFormatInfo object.