diff --git a/solutions/rust/gigasecond/2/src/lib.rs b/solutions/rust/gigasecond/2/src/lib.rs new file mode 100644 index 0000000..b65ca35 --- /dev/null +++ b/solutions/rust/gigasecond/2/src/lib.rs @@ -0,0 +1,7 @@ +use time::PrimitiveDateTime as DateTime; +use time::ext::NumericalDuration; + +// Returns a DateTime one billion seconds after start. +pub fn after(start: DateTime) -> DateTime { + start + 1e9.seconds() +}