macro_rules! utc {
($y:literal-$mo:literal-$d:literal $h:literal:$m:literal:$s:literal) => { ... };
($y:literal-$mo:literal-$d:literal) => { ... };
}Expand description
Create a Point from YYYY-MM-DD hh:mm:ss in UTC
If the hh:mm:ss time component is omitted, it defaults to 00:00:00.
Unfortunately, using this macro with properly formatted dates like 2022-09-22 triggers the clippy lint zero_prefixed_literal for every leading zero (e.g. in 09).
use greg::{utc, Point, Span};
let p1: Point = utc!(2022-09-22);
let p2: Point = utc!(2022-09-22 03:00:00);
let three_hours = Span::HOUR * 3;
assert_eq!(p1 + three_hours, p2);