Skip to main content

encode_smalldatetime

Function encode_smalldatetime 

Source
pub fn encode_smalldatetime(
    dt: NaiveDateTime,
    buf: &mut BytesMut,
) -> Result<(), TypeError>
Expand description

Encode a SMALLDATETIME value (4 bytes): days since 1900 (u16 LE) + minutes since midnight (u16 LE). Seconds are rounded to the nearest minute (30s rounds up per SQL Server semantics).

Returns an error if the date is outside the SMALLDATETIME range (1900-01-01 through 2079-06-06).