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 27 of file day2doy.c.
29 {
30
31 int doy;
32
33
34 if (argc < 4)
35 ERRMSG(
"Give parameters: <year> <mon> <day>");
36
37
38 const int year = atoi(argv[1]);
39 const int mon = atoi(argv[2]);
40 const int day = atoi(argv[3]);
41
42
44 printf("%d %d\n", year, doy);
45
46 return EXIT_SUCCESS;
47}
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.