X509Certificate.FormatDate(DateTime) 方法

定義

將指定的日期和時間轉換成字串。Converts the specified date and time to a string.

protected:
 static System::String ^ FormatDate(DateTime date);
protected static string FormatDate (DateTime date);
static member FormatDate : DateTime -> string
Protected Shared Function FormatDate (date As DateTime) As String

參數

date
DateTime

要轉換的日期和時間。The date and time to convert.

傳回

DateTime 物件之值的字串表示。A string representation of the value of the DateTime object.

備註

某些文化特性無法將未來的日期轉換成字串。Some cultures cannot convert future dates into strings. 如果 x.509 憑證的到期日超出文化特性的範圍,FormatDate 會回到可以表示日期的行事曆。If the expiration date of an X.509 certificate is beyond the range of the culture, FormatDate falls back to a calendar that can express the date. 如果 UmAlQuraCalendarCalendar 值,則會將行事曆變更為 HijriCalendar 類別;否則,它會變更為 InvariantCultureIf the Calendar value is UmAlQuraCalendar, the calendar is changed to the HijriCalendar class; otherwise, it is changed to the InvariantCulture.

適用於