Skip to main content

spread_timestamps

Function spread_timestamps 

Source
pub fn spread_timestamps(
    start: NaiveDateTime,
    end: NaiveDateTime,
    count: usize,
    skip_range_check: bool,
) -> Result<Vec<NaiveDateTime>>
Expand description

count strictly increasing timestamps from start to exactly end.

Gaps are at least 3 hours (or, with skip_range_check, at least 5 minutes when that fits and otherwise as even as possible, but never below one second), with the remaining slack spread randomly. Everything is whole seconds, so the last timestamp is end exactly.