X509Certificate.FormatDate Method (DateTime)

.NET Framework (current version)
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Converts the specified date and time to a string.

Namespace:   System.Security.Cryptography.X509Certificates
Assembly:  mscorlib (in mscorlib.dll)

protected static string FormatDate(
	DateTime date
)

Parameters

date
Type: System.DateTime

The date and time to convert.

Return Value

Type: System.String

A string representation of the value of the DateTime object.

Some cultures cannot convert future dates into strings. 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. If the Calendar value is UmAlQuraCalendar, the calendar is changed to the HijriCalendar class; otherwise, it is changed to the InvariantCulture.

.NET Framework
Available since 4.0
Return to top
Show: