45 int day, hour, min, mon, sec, year;
52 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
53 "Usage: jsec2time <jsec>\n\n" "Use -h for full help.");
56 const double jsec = atof(argv[1]);
59 jsec2time(jsec, &year, &mon, &day, &hour, &min, &sec, &remain);
60 printf(
"%d %d %d %d %d %d %g\n", year, mon, day, hour, min, sec, remain);
71 printf(
"\nMPTRAC jsec2time tool.\n\n");
72 printf(
"Convert seconds since 2000-01-01 00:00 UTC to calendar time.\n");
75 printf(
" jsec2time <jsec>\n");
77 printf(
"Arguments:\n");
78 printf(
" <jsec> Seconds since 2000-01-01 00:00 UTC.\n");
79 printf(
"\nFurther information:\n");
80 printf(
" Manual: https://slcs-jsc.github.io/mptrac/\n");
int main(int argc, char *argv[])
void usage(void)
Print command-line help.
void jsec2time(const double jsec, int *year, int *mon, int *day, int *hour, int *min, int *sec, double *remain)
Converts Julian seconds to calendar date and time components.
MPTRAC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.