Iterating over time range will give a great experience!
NaiveDate has iter_days() and iter_weeks() functions. But in case of NaiveDateTime, it seems necessary to set step_by() to use UNIX timestamps because the period is unknown when iterating over the range.
The request is as follows:
let ts_fmt = "%Y-%m-%d %H:%M";
let start = NaiveDateTime::parse_from_str("2023-02-22 00:00", ts_fmt).unwrap();
let end = NaiveDateTime::parse_from_str("2023-02-23 00:00", ts_fmt).unwrap();
let step = Duration::minutes(15);
// HERE
let lists = (start..end)
.step_by(step)
.map(|ts| {
format!("HELLO: {}", ts);
})
.collect();