Skip to main content

datetime_to_unix_ns

Function datetime_to_unix_ns 

Source
pub(crate) fn datetime_to_unix_ns(instant: DateTime<Utc>) -> i64
Expand description

Converts an instant to Unix nanoseconds, clamping outside the i64 range.

Instants too far in the future become i64::MAX and instants too far in the past become i64::MIN (roughly outside the years 1677 to 2262), so a very wide request range still covers every stored sample.

ยงArguments

  • instant - Instant to convert.