%××××××××××××××××××××××××××××××××××××××××
% GPS time = TAI - 19 seconds. GPS time matched UTC from 1980-01-01
% to 1981-07-01. No leap seconds are inserted into GPS time, thus
% GPS time is 13 seconds ahead of UTC on 2000-01-01. The GPS epoch
% is 00:00 (midnight) UTC on 1980-01-06.
% The differences between GPS Time and International Atomic Time (TAI)
% and Terrestrial Time (TT), also know as Terrestrial Dynamical Time
% (TDT), are constant at the level of some tens of nanoseconds while
% the difference between GPS Time and UTC changes in increments of
% seconds each time a leap second is added to UTC time scale.
% GPS time = TAI - 19秒. 1980-01-01至1981-07-01期間,GPS時間與UTC時間一致.
% 由於GPS時間沒有插入閏秒, 2000-01-01 GPS時間比UTC時間要快13s. GPS曆元起始於
% UTC時間的1980-01-06午夜00:00. GPS時間與TAI、TT(也叫TDT)的差別爲常量, 量
% 值爲數十納秒; GPS時間與UTC時間的差別爲不斷增加的變量,量值爲數秒,這是因爲
% 每當閏年的時候UTC時間就會增加1s
%××××××××××××××××××××××××××××××××××××××××
% GPS時間與TAI時間的轉換(經stk驗證)
% 僅爲簡易驗證,不涉及日期間的加減進位
%輸入數據1
%stk中的TAI時間:10 Jul 2005 04:00:15.000 TAIG
%stk中的GPS時間:10 Jul 2005 03:59:56.000 GPSG
%程序計算時間:03:59:56.000
TAI_time=15.000;
%輸入數據2
%stk中的TAI時間:11 Jul 2005 04:00:32.000 TAIG
%stk中的GPS時間:11 Jul 2005 04:00:13.000 GPSG
%程序計算時間:13s
TAI_time=32.000;
%輸入數據3
%stk中的TAI時間:10 Jul 1950 04:00:15.000 TAIG
%stk中的GPS時間:10 Jul 1950 03:59:56.000 GPSG
%輸入數據4
%stk中的TAI時間:11 Jul 1951 04:00:32.000 TAIG
%stk中的GPS時間:11 Jul 1951 04:00:13.000 GPSG
GPS_time=TAI_time-19