Share via


X509Certificate.FormatDate(DateTime) 方法

定義

將指定的日期和時間轉換成字串。

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

要轉換的日期和時間。

傳回

DateTime 物件之值的字串表示。

備註

某些文化特性無法將未來的日期轉換成字串。 如果 X.509 憑證的到期日超出文化特性的範圍, FormatDate 則會回復為可以表示日期的行事曆。 Calendar如果值為 UmAlQuraCalendar,則行事歷會變更為 HijriCalendar 類別,否則會變更為 InvariantCulture

適用於