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);
69 printf(
"\nJURASSIC time converter.\n\n");
71 (
"Convert Julian seconds since 2000-01-01T00:00Z to calendar time.\n\n");
73 printf(
" jsec2time <jsec>\n\n");
74 printf(
"Arguments:\n");
75 printf(
" <jsec> Seconds since 2000-01-01T00:00Z.\n\n");
77 printf(
" Writes results to standard output as:\n");
78 printf(
" year month day hour minute second remainder\n\n");
79 printf(
"Further information:\n");
80 printf(
" Manual: https://slcs-jsc.github.io/jurassic/\n");
int main(int argc, char *argv[])
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.
JURASSIC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.