Convert date to day of year.
More...
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
| |
Convert date to day of year.
Definition in file day2doy.c.
◆ main()
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 39 of file day2doy.c.
41 {
42
43 int doy;
44
45
47
48
49 if (argc < 4)
50 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
51 "Usage: day2doy <year> <mon> <day>\n\n" "Use -h for full help.");
52
53
54 const int year = atoi(argv[1]);
55 const int mon = atoi(argv[2]);
56 const int day = atoi(argv[3]);
57
58
60 printf("%d %d\n", year, doy);
61
62 return EXIT_SUCCESS;
63}
void day2doy(int year, int mon, int day, int *doy)
Convert a calendar date to day-of-year.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.