00001
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156 #ifndef TIMECNVRT_INCL
00157
00158
00159
00160
00161 #include <sys/types.h>
00162 #include <time.h>
00163
00164
00165
00166
00167
00168 #define TIMECNVRT_INCL 1
00169
00170
00171
00172
00173
00179 typedef double TIME;
00180
00181
00182
00183
00184
00186 #define sprint_at(A, B) (sprint_time (A, B, "TAI", 0))
00187
00188 #define sprint_dt(A, B) (sprint_time (A, B, "TDT", 0))
00189
00190 #define sprint_ut(A, B) (sprint_time (A, B, "UT", 0))
00191 #define CURRENT_SYSTEM_TIME (time (NULL) + UNIX_EPOCH)
00192
00193 #define JULIAN_DAY_ZERO (sscan_time ("JD_0.0"))
00194 #define SOHO_EPOCH (sscan_time ("1958.01.01_00:00:00_TAI"))
00195 #define UNIX_EPOCH (sscan_time ("1970.01.01_00:00:00_UTC"))
00196 #define SOHO_LAUNCH (sscan_time ("1995.12.02_08:08:00_UT"))
00197 #define MDI_FIRST_LIGHT (sscan_time ("1995.12.19_17:49:00_UT"))
00198 #define SOI_START_LOGS (sscan_time ("1996.01.01_00:00:00_TAI"))
00199 #define MISSION_EPOCH (sscan_time ("1993.01.01_00:00:00_TAI"))
00200
00201 extern const int kTIMEIO_MaxTimeEpochStr;
00202 #define DRMS_EPOCH_S "1977.01.01_00:00:00_TAI"
00203 #define DRMS_EPOCH_F (sscan_time(DRMS_EPOCH_S))
00204 #define DRMS_EPOCH (0.000)
00205 #define MDI_EPOCH_S "1993.01.01_00:00:00_TAI"
00206 #define MDI_EPOCH_F (sscan_time(MDI_EPOCH_S))
00207 #define MDI_EPOCH (504921600.000)
00208 #define WSO_EPOCH_S "1601.01.01_00:00:00_UT"
00209 #define WSO_EPOCH_F (sscan_time(WSO_EPOCH_S))
00210 #define WSO_EPOCH (-11865398400.000)
00211 #define TAI_EPOCH_S "1958.01.01_00:00:00_TAI"
00212 #define TAI_EPOCH_F (sscan_time(TAI_EPOCH_S))
00213 #define TAI_EPOCH (-599616000.000)
00214 #define MJD_EPOCH_S "1858.11.17_00:00:00_UT"
00215 #define MJD_EPOCH_F (sscan_time(MJD_EPOCH_S))
00216 #define MJD_EPOCH (-3727641600.000)
00217
00218
00219
00220
00221
00222
00236 extern TIME sscan_time (char *s);
00237
00238 int sscan_time_ext(char *s, TIME *out);
00239
00262 extern void sprint_time (char *s, TIME t, char *zone, int precision);
00263
00279 extern double tai_adjustment (TIME t, char *zone);
00280
00290 extern double zone_adjustment (char *zone);
00291
00292 int zone_isvalid (char *zone);
00293
00304 extern int time_is_invalid (TIME t);
00305
00323 int parsetimestr (const char *timestr,
00324 int **year,
00325 int **month,
00326 int **dofm,
00327 int **dofy,
00328 int **hour,
00329 int **minute,
00330 double **second,
00331 char **zone,
00332 double **juliday,
00333 int *consumedout);
00334
00335 int parse_zone(const char *zonestr, char *out, int size);
00336 #endif
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347