public class HL7DateTimeFormat extends Object
DateTime format for HL7 timestamp: YYYY[MM[DD[HHMM[SS[.S[S[S[S]]]]]]]][+/-ZZZZ]
In the current and future versions of HL7, the precision is indicated by limiting the number of digits used. Thus, YYYY is used to specify a precision of "year," YYYYMM specifies a precision of "month," YYYYMMDD specifies a precision of "day," YYYYMMDDHH is used to specify a precision of "hour," YYYYMMDDHHMM is used to specify a precision of "minute," YYYYMMDDHHMMSS is used to specify a precision of seconds, and YYYYMMDDHHMMSS.SSSS is used to specify a precision of ten thousandths of a second. In each of these cases, the time zone is an optional component. Maximum length of the time stamp is 26 characters.
Examples: |19760704010159-0600| 1:01:59 on July 4, 1976 in the Eastern Standard Time zone. |19760704010159-0500| 1:01:59 on July 4, 1976 in the Eastern Daylight Saving Time zone. |198807000000| Midnight of the night extending from July 4 to July 5, 1988 in the local time zone of the sender. |19880705| Same as prior example, but precision extends only to the day. Could be used for a birthdate, if the time of birth is unknown.
Modifier | Constructor and Description |
---|---|
protected |
HL7DateTimeFormat() |
Modifier and Type | Method and Description |
---|---|
static org.joda.time.format.DateTimeFormatter |
dateTime() |
static org.joda.time.format.DateTimeFormatter |
forPointInTime(PointInTime t) |
static org.joda.time.format.DateTimeFormatter |
forPrecision(Precision p) |
static PointInTime |
parse(String text) |
static PointInTimeFormatter |
pointInTimeParser() |
static org.joda.time.LocalDateTime |
toLocalDateTime(String text) |
static PointInTime |
toPointInTime(String text) |
public static org.joda.time.format.DateTimeFormatter dateTime()
public static org.joda.time.format.DateTimeFormatter forPointInTime(PointInTime t)
public static org.joda.time.format.DateTimeFormatter forPrecision(Precision p)
public static PointInTimeFormatter pointInTimeParser()
public static PointInTime parse(String text)
public static PointInTime toPointInTime(String text)
public static org.joda.time.LocalDateTime toLocalDateTime(String text)
Copyright © 2013 Department of Veterans Affairs. All Rights Reserved.