OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ydhms2ydmsec.c
Go to the documentation of this file.
1 #include <timeutils.h>
2 
3 void ymdhms2ydmsec(int yy, int mm, int dd, int hh, int mn, int sc,
4  int32_t *year, int32_t *day, int32_t *msec) {
5  static int startOfMonth[2][12] ={
6  {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334},
7  {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}};
8 
9  *year = yy;
10  *day = startOfMonth[isleap(yy)][mm - 1] + dd;
11  *msec = 1000 * (sc + 60 * (mn + 60 * hh));
12 }
13 
int32_t day
int32 * msec
Definition: l1_czcs_hdf.c:31
int isleap(int year)
Definition: isleap.c:3
void ymdhms2ydmsec(int yy, int mm, int dd, int hh, int mn, int sc, int32_t *year, int32_t *day, int32_t *msec)
Definition: ydhms2ydmsec.c:3