X509Certificate.FormatDate(DateTime) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的日期和时间转换为字符串。
protected:
static System::String ^ FormatDate(DateTime date);
C#
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。
产品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |