DateTime是否包括第二跳功能?

时间:2019-04-30 03:44:28

标签: vb.net datetime

在本文Are .Net's DateTime methods capable of recognising a Leap Second?中,作者得到的答案是“它(DateTime)不包括可归因于leap秒的滴答数。”

但是,以下代码显示.Net DateTime支持leap秒。有专家可以解释为什么吗?

Dim GPS_Time_Base_Point As DateTime = New DateTime(1980, 1, 6, 0, 0, 0, DateTimeKind.Unspecified)
Dim A_test_time As DateTime = New DateTime(2019, 4, 16, 18, 29, 0, DateTimeKind.Unspecified)

Dim TimeSpan As TimeSpan = A_test_time - GPS_Time_Base_Point
Dim GPS_Time_At_LIGO_for_2019_4_16_18_29_0 As UInt64 = 1239474558 'https://www.andrews.edu/~tzs/timeconv/timeconvert.php
Dim DifSeconds As Integer = TimeSpan.TotalSeconds - 1239474558
Debug.Print(" Second dif:" + CDbl(DifSeconds).ToString)

输出为“ Second dif:-18”,等于gpstime-UTC时间的f秒dif。

0 个答案:

没有答案