Innovenergy_trunk/csharp/Lib/Time/Unix/UnixTime.cs

14 lines
376 B
C#

// ReSharper disable ArrangeStaticMemberQualifier
namespace InnovEnergy.Lib.Time.Unix;
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;
}