|
@ -21,7 +21,7 @@ |
|
|
#define TAI_PACK 8 |
|
|
#define TAI_PACK 8 |
|
|
#define TAI_UTC_DIFF ((uint64_t)4611686018427387914ULL) |
|
|
#define TAI_UTC_DIFF ((uint64_t)4611686018427387914ULL) |
|
|
|
|
|
|
|
|
//#define UTC_ADJUST -36
|
|
|
//#define UTC_ADJUST -37
|
|
|
#define tai_approx(t) ((double) ((t)->x)) |
|
|
#define tai_approx(t) ((double) ((t)->x)) |
|
|
#define tai_less(t,u) ((t)->x < (u)->x) |
|
|
#define tai_less(t,u) ((t)->x < (u)->x) |
|
|
|
|
|
|
|
@ -300,7 +300,7 @@ void tai_add(struct tai *t,struct tai *u,struct tai *v) { t->x = u->x + v->x; } |
|
|
void tai_sub(struct tai *t,struct tai *u,struct tai *v) { t->x = u->x - v->x; } |
|
|
void tai_sub(struct tai *t,struct tai *u,struct tai *v) { t->x = u->x - v->x; } |
|
|
|
|
|
|
|
|
// {"leapseconds":["+1972-06-30", "+1972-12-31", "+1973-12-31", "+1974-12-31", "+1975-12-31", "+1976-12-31", "+1977-12-31", "+1982-06-30", "+1983-06-30", "+1985-06-30", "+1987-12-31", "+1989-12-31", "+1990-12-31", "+1992-06-30", "+1993-06-30", "+1994-06-30", "+1995-12-31", "+1997-06-30", "+1998-12-31", "+2005-12-31", "+2008-12-31", "+2012-06-30", "+2015-06-30"]}
|
|
|
// {"leapseconds":["+1972-06-30", "+1972-12-31", "+1973-12-31", "+1974-12-31", "+1975-12-31", "+1976-12-31", "+1977-12-31", "+1982-06-30", "+1983-06-30", "+1985-06-30", "+1987-12-31", "+1989-12-31", "+1990-12-31", "+1992-06-30", "+1993-06-30", "+1994-06-30", "+1995-12-31", "+1997-06-30", "+1998-12-31", "+2005-12-31", "+2008-12-31", "+2012-06-30", "+2015-06-30"]}
|
|
|
char *leapseconds[] = { "+1972-06-30", "+1972-12-31", "+1973-12-31", "+1974-12-31", "+1975-12-31", "+1976-12-31", "+1977-12-31", "+1982-06-30", "+1983-06-30", "+1985-06-30", "+1987-12-31", "+1989-12-31", "+1990-12-31", "+1992-06-30", "+1993-06-30", "+1994-06-30", "+1995-12-31", "+1997-06-30", "+1998-12-31", "+2005-12-31", "+2008-12-31", "+2012-06-30", "+2015-06-30" }; |
|
|
char *leapseconds[] = { "+1972-06-30", "+1972-12-31", "+1973-12-31", "+1974-12-31", "+1975-12-31", "+1976-12-31", "+1977-12-31", "+1982-06-30", "+1983-06-30", "+1985-06-30", "+1987-12-31", "+1989-12-31", "+1990-12-31", "+1992-06-30", "+1993-06-30", "+1994-06-30", "+1995-12-31", "+1997-06-30", "+1998-12-31", "+2005-12-31", "+2008-12-31", "+2012-06-30", "+2015-06-30", "+2016-12-31" }; |
|
|
struct tai leaptais[sizeof(leapseconds)/sizeof(*leapseconds)]; |
|
|
struct tai leaptais[sizeof(leapseconds)/sizeof(*leapseconds)]; |
|
|
|
|
|
|
|
|
char *dayname[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } ; |
|
|
char *dayname[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" } ; |
|
@ -355,7 +355,7 @@ struct tai tai_now() |
|
|
{ |
|
|
{ |
|
|
First_TAI = t, First_utc = (uint32_t)now; |
|
|
First_TAI = t, First_utc = (uint32_t)now; |
|
|
#ifndef DISABLE_LEAPS |
|
|
#ifndef DISABLE_LEAPS |
|
|
UTC_ADJUST = -36; |
|
|
UTC_ADJUST = -37; |
|
|
#endif |
|
|
#endif |
|
|
//printf("TAINOW.%llu %03.3f UTC.%u vs %u [diff %d]\n",(long long)t.x,t.millis,First_utc,tai2utc(t),UTC_ADJUST);
|
|
|
//printf("TAINOW.%llu %03.3f UTC.%u vs %u [diff %d]\n",(long long)t.x,t.millis,First_utc,tai2utc(t),UTC_ADJUST);
|
|
|
} |
|
|
} |
|
|