예제 #1
0
        protected DateTimeOffset GetTime(long unixTime, DateTimeOffsetUnixConverterOptions options)
        {
            long seconds = options.HasFlag(DateTimeOffsetUnixConverterOptions.MilliSecondsNotSeconds)
                ? unixTime / 1000
                : unixTime;

            return(DateTimeOffset.FromUnixTimeSeconds(seconds));
        }
예제 #2
0
        protected long GetUnixTime(DateTimeOffset time, DateTimeOffsetUnixConverterOptions options)
        {
            long seconds   = time.ToUnixTimeSeconds();
            long timeValue = options.HasFlag(DateTimeOffsetUnixConverterOptions.MilliSecondsNotSeconds)
                ? seconds * 1000
                : seconds;

            return(timeValue);
        }