Module datetime

Source
Expand description

Timestamp parsing and utilities to translate to and from the chrono and time crates.

Modules§

chrono
Utilies to convert back and forth between chrono’s data structures and the hl7-parser ones All implementations here are implemented as TryFrom and From traits between the TimeStamp struct and various chrono types. This allows for easy conversion between the two types. The TryFrom implementations will return an error if the conversion is not possible, such as if the date or time components are invalid. The From implementations will always succeed and will set missing components to zero or the epoch if necessary.
jiff
Utilies to convert back and forth between jiff’s data structures and the hl7-parser ones All implementations here are implemented as TryFrom and From traits between the TimeStamp struct and various chrono types. This allows for easy conversion between the two types. The TryFrom implementations will return an error if the conversion is not possible, such as if the date or time components are invalid. The From implementations will always succeed and will set missing components to zero or the epoch if necessary.
time_crate
Utilies to convert back and forth between time’s data structures and the hl7-parser ones All implementations here are implemented as TryFrom and From traits between the TimeStamp struct and various time types. This allows for easy conversion between the two types. The TryFrom implementations will return an error if the conversion is not possible, such as if the date or time components are invalid. The From implementations will always succeed and will set missing components to zero or the epoch if necessary.

Structs§

Date
A parsed date without a time component
Time
The results of parsing a timestamp. Note that the timestamp is not validated, i.e. it may not be a valid date or time.
TimeStamp
The results of parsing a timestamp. Note that the timestamp is not validated, i.e. it may not be a valid date or time.
TimeStampOffset
A parsed timezone offset in hours and minutes

Enums§

DateTimeParseError
Errors that can result from parsing HL7 timestamps
ErroredDateTimeComponent

Traits§

DateTime
Trait for parsing HL7 date and time strings into Date, Time, and TimeStamp structs

Functions§

parse_date
Parse an HL7 date in the format: YYYY[MM[DD]
parse_time
Parse an HL7 time in the format: HH[MM[SS[.S[S[S[S]]]]]][+/-ZZZZ]
parse_timestamp
Parse an HL7 timestamp in the format: YYYY[MM[DD[HH[MM[SS[.S[S[S[S]]]]]]]]][+/-ZZZZ]