protected DateTimeOffset GetTime(long unixTime, DateTimeOffsetUnixConverterOptions options) { long seconds = options.HasFlag(DateTimeOffsetUnixConverterOptions.MilliSecondsNotSeconds) ? unixTime / 1000 : unixTime; return(DateTimeOffset.FromUnixTimeSeconds(seconds)); }
protected long GetUnixTime(DateTimeOffset time, DateTimeOffsetUnixConverterOptions options) { long seconds = time.ToUnixTimeSeconds(); long timeValue = options.HasFlag(DateTimeOffsetUnixConverterOptions.MilliSecondsNotSeconds) ? seconds * 1000 : seconds; return(timeValue); }