Time Display Format

From DOC

Jump to: navigation, search


NOTE: This is a specification - it is not yet implemented.

The format for displaying an HL7 point in time (TS datatype) depends on the precision of the time being displayed. See Time Precision.

  • yyyy - yyyy, for example, 2009
  • yyyymm - MM/yyyy, for example, 06/2009
  • yyyymmdd - MM/dd/yyyy, for example, 06/02/2009
  • yyyymmddhh - MM/dd/yyyy hh, for example, 06/02/2009 2 pm
  • yyyymmddhhmm - MM/dd/yyyy hh:mm, for example, 06/02/2009 2:19 pm
  • yyyymmddhhmmss - MM/dd/yyyy hh:mm:ss, for example, 06/02/2009 2:19:37 pm

If timezone is also specified in the time field, then it can also be displayed. However, since the underlying HL7 specification specifies timezone as an offset in hours from GMT, the timezone name may be hard to determine. The advantage of the offset in hours and minutes is that the stored format is not subject to changes in daylight saving time or political boundaries.

Pattern Characters

Pattern Description Example
yy Year 09
yyyy Year 2009
M Month of year (without leading zero) 8
MM Month of year 08
MMM Month of year abbreviation based on Locale Aug
MMMM Month of year based on Locale August
dd Day of Month 04
d Day of Month (without leading zero) 4
H Hour in day (0-23) 14
h Hour in am/pm (1-12) 14
K Hour in day (1-24) 15
k Hour in am/pm (0-12) 15
mm Minute in Hour 19
ss Second in minute 37
A AM or PM PM
a am or pm pm
zzzz Timezone offset

Special characters are inserted directly.

Resource bundle properties

The time formats are specified in the corresponding resource bundle. A property defines the format for each precision.

  • tolven.format.TS.yyyy=yyyy
  • tolven.format.TS.yyyymm=MM/yyyy
  • tolven.format.TS.yyyymmdd=MM/dd/yyyy
  • tolven.format.TS.yyyymmddhh=MM/dd/yyyy hh
  • tolven.format.TS.yyyymmddhhmm=MM/dd/yyyy hh:mm
  • tolven.format.TS.yyyymmddhhmmss=MM/dd/yyyy hh:mm:ss

Locale

The time format properties vary by locale. To be useful, the full locale (with country) should be specified in the user or account preference. Language alone typically does not indicate a useful preference for time format.

Personal tools