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

27 lines
1.4 KiB
C#
Raw Normal View History

// using InnovEnergy.Lib.Utils;
//
// namespace InnovEnergy.Lib.Time.Unix;
//
// public readonly partial struct UnixTime
// {
// public static UnixTime operator -(UnixTime a, TimeSpan b) => FromTicks(a.Ticks - GetUnixTicks(b));
// public static UnixTime operator +(UnixTime a, TimeSpan b) => FromTicks(a.Ticks + GetUnixTicks(b));
// public static UnixTime operator +(TimeSpan a, UnixTime b) => FromTicks(GetUnixTicks(a) + b.Ticks);
//
// public static Double operator /(UnixTime a, TimeSpan b) => a.Ticks.ConvertTo<Double>() / b.Ticks;
// public static Int32 operator %(UnixTime a, TimeSpan b) => a.Ticks % GetUnixTicks(b);
//
// public static Boolean operator < (UnixTime l, UnixTime r) => l.Ticks < r.Ticks;
// public static Boolean operator > (UnixTime l, UnixTime r) => l.Ticks > r.Ticks;
// public static Boolean operator <= (UnixTime l, UnixTime r) => l.Ticks <= r.Ticks;
// public static Boolean operator >= (UnixTime l, UnixTime r) => l.Ticks >= r.Ticks;
// public static Boolean operator == (UnixTime l, UnixTime r) => l.Ticks == r.Ticks;
// public static Boolean operator != (UnixTime l, UnixTime r) => l.Ticks != r.Ticks;
//
// public static TimeSpan operator -(UnixTime a, UnixTime b) => TimeSpan.FromSeconds(a.Ticks - b.Ticks);
//
// private static Int32 GetUnixTicks(TimeSpan ts)
// {
// return (Int32) (ts.Ticks / 10000000L);
// }
// }