Asn1DateTimeCreateRfcDateTime Method
Encodes a .NET DateTime object to a ASN.1-encoded byte array. This method is designed to conform
RFC 5280 requirement, so dates before 1950 and
after 2050 year are required to be encoded by using Generalized Time encoding. UTC Time encoding is not allowed
for periods beyond 1950 - 2049 years.
Namespace: SysadminsLV.Asn1Parser.UniversalAssembly: SysadminsLV.Asn1Parser (in SysadminsLV.Asn1Parser.dll) Version: 1.2.11
public static Asn1DateTime CreateRfcDateTime(
DateTime time,
TimeZoneInfo zone = null
)
Public Shared Function CreateRfcDateTime (
time As DateTime,
Optional zone As TimeZoneInfo = Nothing
) As Asn1DateTime
public:
static Asn1DateTime^ CreateRfcDateTime(
DateTime time,
TimeZoneInfo^ zone = nullptr
)
static member CreateRfcDateTime :
time : DateTime *
?zone : TimeZoneInfo
(* Defaults:
let _zone = defaultArg zone null
*)
-> Asn1DateTime
- time DateTime
-
An instance of DateTime object.
- zone TimeZoneInfo (Optional)
-
Specifies the time zone for the value in time parameter.
Asn1DateTimeASN.1 type object.
If the
Year value of the
time object is less or equals to 2049
and greater or equals to 1950, an
Asn1UtcTime object is returned.
If year value is outside of 1950-2049 range, an
Asn1GeneralizedTime object is returned.
If zone parameter is set to NULL, date and time in time
parameter will be converted to a Zulu time (Universal time). If zone information is not NULL,
date and time in time parameter will be converted to a GMT time and time zone will be added
to encoded value.