JURASSIC
Functions
jsec2time.c File Reference

Convert Julian seconds to date. More...

#include "jurassic.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 39 of file jsec2time.c.

41 {
42
43 double remain;
44
45 int day, hour, min, mon, sec, year;
46
47 /* Print usage information... */
48 USAGE;
49
50 /* Check arguments... */
51 if (argc < 2)
52 ERRMSG("Missing or invalid command-line arguments.\n\n"
53 "Usage: jsec2time <jsec>\n\n" "Use -h for full help.");
54
55 /* Read arguments... */
56 const double jsec = atof(argv[1]);
57
58 /* Convert time... */
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);
61
62 return EXIT_SUCCESS;
63}
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: jurassic.c:4354
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: jurassic.h:1325
#define USAGE
Print usage information on -h or --help.
Definition: jurassic.h:1206
Here is the call graph for this function: