Skip to main content

date_stem

Function date_stem 

Source
pub fn date_stem(epoch_secs: i64) -> String
Expand description

The UTC calendar date yyyy-mm-dd for epoch_secs seconds since the Unix epoch — the daily tool-call-log filename stem. Pure (it reads no clock), via Howard Hinnant’s civil-from-days algorithm, so it is deterministic and testable; the caller supplies the current time.

§Examples

use coding_tools::steer::date_stem;
assert_eq!(date_stem(0), "1970-01-01");
assert_eq!(date_stem(1_600_000_000), "2020-09-13");