Skip to main content

parse_optional_datetime_to_unix_nanos

Function parse_optional_datetime_to_unix_nanos 

Source
pub fn parse_optional_datetime_to_unix_nanos(
    value: &Option<DateTime<Utc>>,
    field: &str,
) -> UnixNanos
Expand description

Parses the given datetime (UTC) into a UnixNanos timestamp. If value is None, then defaults to the UNIX epoch (0 nanoseconds).

Returns epoch (0) for invalid timestamps that cannot be converted to nanoseconds.