ASN.1 UTCTime tag: 23

The ASN.1 UTCTime type is similar to the VisibleString type (their encoding is identical), however, it has a more restricted format, as follows: a UTCTime string value contains a two-digit year, a two-digit month, a two-digit day, a two-digit hour, and a two-digit minute. Optionally, a two-digit second can be added. The string ends with an uppercase Z ("YYMMDDhhmm[ss]Z"). For example, for "8:30 p.m. on April 15, 1988", the resulting string (with seconds omitted) is "8804152030Z". Instead of ending with a Z, the string may end with a "+" or "-", followed by a two-digit hour and two-digit minute. Instead of indicating UTC time, the first part of the string represents local time, and the final characters indicate the differential from UTC time. To represent the local time "8:30 p.m. on April 15, 1988" in an area 6 hours behind UTC time, "8804152030-0600" is used.

Because a two-digit year is used (rather than a four-digit year), there might be ambiguity regarding which century is being represented by the date. Therefore, it is recommended to use DATE, TIME-OF-DAY, or DATE-TIME types instead of UTCTime.


CreationTime ::= UTCTime
UTCTime encoding example
T1 ::= UTCTime
fileLastModified T1 ::= "9604152030Z"

In BER, the UTCTime type value defined in the example above is encoded as follows:

17 0B 393630343135323033305A


The UTCTime type can be constrained by a single value.

Related Topics