JURASSIC
Functions
time2jsec.c File Reference

Convert date to Julian seconds. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

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

Detailed Description

Convert date to Julian seconds.

Definition in file time2jsec.c.

Function Documentation

◆ main()

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

Definition at line 39 of file time2jsec.c.

41 {
42
43 double jsec;
44
45 /* Print usage information... */
46 USAGE;
47
48 /* Check arguments... */
49 if (argc < 8)
50 ERRMSG("Missing or invalid command-line arguments.\n\n"
51 "Usage: time2jsec <year> <mon> <day> <hour> <min> <sec> <remain>\n\n"
52 "Use -h for full help.");
53
54 /* Read arguments... */
55 const int year = atoi(argv[1]);
56 const int mon = atoi(argv[2]);
57 const int day = atoi(argv[3]);
58 const int hour = atoi(argv[4]);
59 const int min = atoi(argv[5]);
60 const int sec = atoi(argv[6]);
61 const double remain = atof(argv[7]);
62
63 /* Convert... */
64 time2jsec(year, mon, day, hour, min, sec, remain, &jsec);
65 printf("%.2f\n", jsec);
66
67 return EXIT_SUCCESS;
68}
void time2jsec(const int year, const int mon, const int day, const int hour, const int min, const int sec, const double remain, double *jsec)
Converts time components to seconds since January 1, 2000, 12:00:00 UTC.
Definition: jurassic.c:7205
#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: