pub fn encode_datetime<W>(mut to: W, dt: DateTime<FixedOffset>) -> IoResult<usize>
where
    W: Write,
{
    let mut bytes = encode_date(&mut to, dt.date().naive_utc())?;
    bytes += encode_time(&mut to, dt.time())?;
    let offset = *dt.offset();
    if offset != FixedOffset::east(0) {
        let offset_hm = offset.local_minus_utc() / 60;
        let offset_h = offset_hm / 60;
        let offset_m = offset_hm % 60;
        write!(to, "{:+03}{:02}", offset_h, offset_m)?;
        bytes += 5;
    }
    Ok(bytes)
}
/** Encode a single date-time value in accordance to the DICOM DateTime (DT)
 * value representation.
 */
Encode a single date-time value in accordance to the DICOM DateTime (DT)
value representation.
Encode a single date - time value in accordance to the DICOM DateTime ( DT ) value representation .
pub fn encode_datetime<W>(mut to: W, dt: DateTime<FixedOffset>) -> IoResult<usize>
where
    W: Write,
{
    let mut bytes = encode_date(&mut to, dt.date().naive_utc())?;
    bytes += encode_time(&mut to, dt.time())?;
    let offset = *dt.offset();
    if offset != FixedOffset::east(0) {
        let offset_hm = offset.local_minus_utc() / 60;
        let offset_h = offset_hm / 60;
        let offset_m = offset_hm % 60;
        write!(to, "{:+03}{:02}", offset_h, offset_m)?;
        bytes += 5;
    }
    Ok(bytes)
}
pub fn encode_datetime < W > ( mut to : W , dt : DateTime < FixedOffset > ) -> IoResult < usize > where W : Write , { let mut bytes = encode_date ( & mut to , dt . date ( ) . naive_utc ( ) ) ? ; bytes += encode_time ( & mut to , dt . time ( ) ) ? ; let offset = * dt . offset ( ) ; if offset != FixedOffset :: east ( 0 ) { let offset_hm = offset . local_minus_utc ( ) / 60 ; let offset_h = offset_hm / 60 ; let offset_m = offset_hm % 60 ; write ! ( to " " offset_h offset_m ) ? ; bytes += 5 ; } Ok ( bytes ) }
Encode a single date-time value in accordance to the DICOM DateTime (DT)
 value representation.
Encode a single date - time value in accordance to the DICOM DateTime ( DT ) value representation .
to
W
dt
DateTime<FixedOffset>
to
W
dt
DateTime<FixedOffset>