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
32 if (argc < 4)
33 ERRMSG(
"Give parameters: <year> <mon> <day>");
34
35
36 const int year = atoi(argv[1]);
37 const int mon = atoi(argv[2]);
38 const int day = atoi(argv[3]);
39
40
41 int doy;
43 printf("%d %d\n", year, doy);
44
45 return EXIT_SUCCESS;
46}
void day2doy(const int year, const int mon, const int day, int *doy)
Get day of year from date.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.