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