Note: Refer to the article Dates and times in CDA for an overview of that subject, and links to other relevant CDA PRO Know articles and CDA PRO Learn sessions.

A moment in time is often termed a “timestamp” in CDA. There are many contexts in which an XML sub-element is added to “something” in CDA in order to capture the moment in time when that “something” happened.

Usually, an XML element in CDA that represents a moment in time is named time – but it can also be named birthTime, effectiveTime, or something else.

Timestamp Format
The XML element capturing a timestamp uses its value attribute to hold a string that represents the date and time. That string has the format: YYYYMMDDhhmmss.SSSS±ZZzz, which is broken down as follows:

  • YYYY: 4 digit year
  • MM: 2 digit month (e.g. 04 for April)
  • DD: 2 digit day of month (e.g. 07 for the 7th)
  • hh: 2 digit hour (e.g. 06 for 6am or 18 for 6pm)
  • ss: 2 digit seconds
  • .SSSS: up to four digits for fractions of a second
  • ±ZZzz: time-zone expressed as offset from UTC
    • + means ahead of UTC (e.g. in Asia Pacific)
    • - means behind UTC (e.g. in US)
    • ZZ is hour offset, zz is minutes offset (for the few time-zones that use it)

So, for example, Aug 22, 2013 6:15pm would be represented as follows in an XML element named effectiveTime that contained the timestamp:

<effectiveTime value='201308221815' />

Timestamp Granularity
The granularity of the “moment in time” can range from fractions of a second up to a millenium. Here are some additional examples of timestamps in XML elements named time:

The Year 1954

<time value='1954' />

The Month August 1987

<time value='198708' />

The Day July 4, 1776

<time value='17760704' />

August 22, 2013 6:15pm

<time value='201308221815' />

November 25, 2013 6:30am 25.5 seconds

<time value='20131125063025.5' />

December 1, 2013 8am, Los Angeles Time (PST)

<time value='201312010800-0800' />

Other CDA PRO Know Articles Referenced In This Article