2023-02-16 12:57:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
// ReSharper disable ArrangeStaticMemberQualifier
|
|
|
|
|
2023-02-25 14:53:58 +00:00
|
|
|
namespace InnovEnergy.Lib.Time.Unix;
|
2023-02-16 12:57:06 +00:00
|
|
|
|
|
|
|
public readonly partial struct UnixTime
|
|
|
|
{
|
|
|
|
// IMPORTANT: init is necessary for JSON deserializer
|
|
|
|
// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global
|
2023-07-24 08:55:58 +00:00
|
|
|
public UInt32 Ticks { get; init; }
|
|
|
|
|
|
|
|
public UnixTime RoundTo(UnixTimeSpan span) => Epoch + this / span * span;
|
2023-02-16 12:57:06 +00:00
|
|
|
}
|