add roundto to unixTime

This commit is contained in:
atef 2023-07-24 10:55:58 +02:00
parent 6270a0d8a3
commit 91c979cca2
1 changed files with 3 additions and 1 deletions

View File

@ -9,4 +9,6 @@ public readonly partial struct UnixTime
// IMPORTANT: init is necessary for JSON deserializer
// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global
public UInt32 Ticks { get; init; }
public UnixTime RoundTo(UnixTimeSpan span) => Epoch + this / span * span;
}