29 {
30
31 double remain;
32
33 int day, hour, min, mon, sec, year;
34
35
36 if (argc < 2)
37 ERRMSG(
"Give parameters: <jsec>");
38
39
40 const double jsec = atof(argv[1]);
41
42
43 jsec2time(jsec, &year, &mon, &day, &hour, &min, &sec, &remain);
44 printf("%d %d %d %d %d %d %g\n", year, mon, day, hour, min, sec, remain);
45
46 return EXIT_SUCCESS;
47}
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.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.