Go to the documentation of this file.
6 int main(
int argc,
char *argv[]) {
15 double leapSecondsAt93 = 27;
16 double tai58at93 = 1104537600.0 + leapSecondsAt93;
17 double unixAt93 =
ymds2unix(1993, 1, 1, 0.0);
21 printf(
"%s unix=%.1f, TAI93=%.1f\n",
unix2isodate(unixTime,
'G'), unixTime, tai93Time);
25 printf(
"%s unix=%.1f, TAI93=%.1f\n",
unix2isodate(unixTime,
'G'), unixTime, tai93Time);
29 printf(
"%s unix=%.1f, TAI93=%.1f\n",
unix2isodate(unixTime,
'G'), unixTime, tai93Time);
32 printf(
"%s unix=%.1f, TAI93=%.1f\n",
unix2isodate(unixTime,
'G'), unixTime, tai93Time);
36 printf(
"unix93 - unix58 = %.1f\n", u93-u58);
44 for(
int i=0;
i<22;
i++) {
47 leapSeconds = tai93Time - (unixTime - unixAt93) + leapSecondsAt93;
48 printf(
"%s unix=%.1f, TAI58=%.1f, TAI93=%.1f, leap=%.1f\n",
unix2isodate(unixTime,
'G'),
49 unixTime, tai58Time, tai93Time, leapSeconds);
59 for(
int i=0;
i<23;
i++) {
61 tai58Time = tai93Time + tai58at93;
62 leapSeconds = tai93Time - (unixTime - unixAt93) + leapSecondsAt93;
63 printf(
"%s unix=%.1f, TAI58=%.1f, TAI93=%.1f, leap=%.1f\n",
unix2isodate(unixTime,
'G'),
64 unixTime, tai58Time, tai93Time, leapSeconds);
72 double unix_times[] = {1435708799, 1435708799, 1435708800, 1435708801};
73 double tai58[] = {1814400034, 1814400035, 1814400036, 1814400037};
74 double tai93[] = { 709862407, 709862408, 709862409, 709862410};
78 for(
int i=0;
i<numPoints;
i++) {
82 if(tai58Time != tai58[
i]) {
83 printf(
"unix_to_tai58(%.1f) Failed, %.1f != %.1f\n", unix_times[
i], tai58Time, tai58[
i]);
84 returnVal = EXIT_FAILURE;
87 if(tai93Time != tai93[
i]) {
88 printf(
"unix_to_tai93(%.1f) Failed, %.1f != %.1f\n", unix_times[
i], tai58Time, tai58[
i]);
89 returnVal = EXIT_FAILURE;
95 for(
int i=0;
i<numPoints;
i++) {
97 if(unixTime != unix_times[
i]) {
98 printf(
"tai58_to_unix(%.1f) Failed, %.1f != %.1f\n", tai58[
i], unixTime, unix_times[
i]);
99 returnVal = EXIT_FAILURE;
102 if(unixTime != unix_times[
i]) {
103 printf(
"tai93_to_unix(%.1f) Failed, %.1f != %.1f\n", tai93[
i], unixTime, unix_times[
i]);
104 returnVal = EXIT_FAILURE;
double unix_to_tai93(double unixtime)
double tai93_to_unix(double tai93)
double unix_to_tai58(double unixtime)
int main(int argc, char *argv[])
double tai58_to_unix(double tai58)
char * unix2isodate(double dtime, char zone)
double ymds2unix(short year, short month, short day, double secs)