dicom_core::value::deserialize

Function parse_datetime

Source
pub fn parse_datetime(
    buf: &[u8],
    dt_utc_offset: FixedOffset,
) -> Result<DateTime<FixedOffset>, Error>
👎Deprecated since 0.7.0: Use parse_datetime_partial() then to_precise_datetime()
Expand description

Retrieve a chrono::DateTime from the given text, while assuming the given UTC offset.

If a date/time component is missing, the operation fails. Presence of the second fraction component .FFFFFF is mandatory with at least one digit accuracy .F while missing digits default to zero.

parse_datetime_partial should be preferred, because it is more flexible and resilient to missing components. See also the implementation of FromStr for DicomDateTime.