MCPcopy Create free account
hub / github.com/apache/datafusion / datetime_to_days

Function datetime_to_days

datafusion/functions/src/datetime/current_date.rs:144–149  ·  view source on GitHub ↗

Converts a DateTime to the number of days since Unix epoch (1970-01-01)

(dt: &T)

Source from the content-addressed store, hash-verified

142
143/// Converts a DateTime to the number of days since Unix epoch (1970-01-01)
144fn datetime_to_days<T: Datelike>(dt: &T) -> i32 {
145 dt.num_days_from_ce()
146 - NaiveDate::from_ymd_opt(1970, 1, 1)
147 .unwrap()
148 .num_days_from_ce()
149}

Callers 1

simplifyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…