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

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