MPTRAC
Functions
jsec2time.c File Reference

Convert Julian seconds to date. More...

#include "mptrac.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Convert Julian seconds to date.

Definition in file jsec2time.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 27 of file jsec2time.c.

29 {
30
31 double remain;
32
33 int day, hour, min, mon, sec, year;
34
35 /* Check arguments... */
36 if (argc < 2)
37 ERRMSG("Give parameters: <jsec>");
38
39 /* Read arguments... */
40 double jsec = atof(argv[1]);
41
42 /* Convert time... */
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.
Definition: mptrac.c:1832
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: mptrac.h:1901
Here is the call graph for this function: