ASN.1 TIME tag: 14

The ASN.1 TIME type fully supports ISO 8601 (the definitive standard for time and date representations). The main features of ISO 8601 are as follows:

  • The identification of date only, of time of day (local time or UTC or both) only, and of date and time.
  • The identification of time intervals using either a start and end point, a duration, or a duration with either a start or an end point.
  • The concept of specifying a recurring time interval.

The useful time types (DATE, TIME-OF-DAY, DATE-TIME) are defined as subsets of the TIME type.

Example

TimeType ::= TIME
TIME encoding example

Week date Friday 12 April 1985:

date1 TIME ::= "1985-W15-5"
              -- BER: 0E 0A 313938352D5731352D35

The 12th April in the 2nd year before the year 0000:

date2 TIME ::= "-0002-04-12"
              -- BER: 0E 0B 2D303030322D30342D3132 

Local time with decimal fractions using comma - 27 minutes and 35 and a half second past 15 hours:

time1 TIME ::= "15:27:35,5"
               -- DER: 0E 0A 31353A32373A33352E35 

Local time of the day and the difference from UTC - 27 minutes 46 seconds past 15 hours locally in Geneva (one hour ahead of UTC):

time2 TIME ::= "15:27:46+01:00"
               -- DER: 0E 0B 31353A32373A34362B3031

Constraints

The TIME type can be constrained by a single value, by type inclusion, by duration range, time point range, recurrence range, and by inner subtyping (in particular cases).

Related Topics