2023-09-14 12:20:30 +00:00
|
|
|
// namespace InnovEnergy.Lib.Time.Unix;
|
|
|
|
//
|
|
|
|
// public readonly partial struct UnixTime
|
|
|
|
// {
|
|
|
|
// public static UnixTime FromTicks(Int32 ticks) => new UnixTime { Ticks = ticks };
|
|
|
|
//
|
|
|
|
// public static UnixTime FromUtcDateTime(DateTime dateTime)
|
|
|
|
// {
|
|
|
|
// var timeSinceEpoch = dateTime - DateTime.UnixEpoch;
|
|
|
|
// var ticks = (Int32) timeSinceEpoch.TotalSeconds;
|
|
|
|
//
|
|
|
|
// return new UnixTime{ Ticks = ticks};
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// public static UnixTime Epoch => new UnixTime { Ticks = 0 };
|
|
|
|
// public static UnixTime Now => FromUtcDateTime(DateTime.UtcNow);
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|