Beispiel #1
0
    public static void TestRoundtripUnixTimes()
    {
        foreach (var test in s_testTimes)
        {
            // Roundtrip Unix time in milliseconds
            DateTimeOffset dateTime = DateTimeOffset.FromUnixTimeMilliseconds(test.UnixTimeMilliseconds);
            TestToUnixTimeMilliseconds(TestTime.FromMilliseconds(dateTime, test.UnixTimeMilliseconds));

            // Roundtrip Unix time in seconds
            dateTime = DateTimeOffset.FromUnixTimeSeconds(test.UnixTimeSeconds);
            TestToUnixTimeSeconds(TestTime.FromSeconds(dateTime, test.UnixTimeSeconds));
        }
    }
Beispiel #2
0
    public static void TestRoundtripDateTimes()
    {
        foreach (var test in s_testTimes)
        {
            // Roundtrip through Unix time in milliseconds
            long unixTimeMilliseconds = test.DateTimeOffset.ToUnixTimeMilliseconds();
            TestFromUnixTimeMilliseconds(TestTime.FromMilliseconds(test.DateTimeOffset, unixTimeMilliseconds));

            // Roundtrip through Unix time in seconds
            long unixTimeSeconds = test.DateTimeOffset.ToUnixTimeSeconds();
            TestFromUnixTimeSeconds(TestTime.FromSeconds(test.DateTimeOffset, unixTimeSeconds));
        }
    }
Beispiel #3
0
        public static void ToQuaranTimeSeconds_RoundTrip(TestTime test)
        {
            long quaranTimeSeconds = test.DateTimeOffset.ToQuaranTimeSeconds();

            FromQuaranTimeSeconds(TestTime.FromSeconds(test.DateTimeOffset, quaranTimeSeconds));
        }
Beispiel #4
0
        public static void FromQuaranTimeSeconds_RoundTrip(TestTime test)
        {
            DateTimeOffset dateTime = QuaranTime.FromQuaranTimeSeconds(test.QuaranTimeSeconds);

            ToQuaranTimeSeconds(TestTime.FromSeconds(dateTime, test.QuaranTimeSeconds));
        }
Beispiel #5
0
    public static void TestFromUnixTimeSeconds_RoundTrip(TestTime test)
    {
        DateTimeOffset dateTime = DateTimeOffset.FromUnixTimeSeconds(test.UnixTimeSeconds);

        TestToUnixTimeSeconds(TestTime.FromSeconds(dateTime, test.UnixTimeSeconds));
    }
Beispiel #6
0
    public static void TesToUnixTimeSeconds_RoundTrip(TestTime test)
    {
        long unixTimeSeconds = test.DateTimeOffset.ToUnixTimeSeconds();

        TestFromUnixTimeSeconds(TestTime.FromSeconds(test.DateTimeOffset, unixTimeSeconds));
    }