/*----------------------------------------------------------------------*\ | Utility routines to convert FIPS dates to and from struct tm | | | | Routines that write date as string to address given by argument: | | tm_to_yd from struct tm, generate FIPS date in YYDDD form | | tm_to_yyd from struct tm, generate FIPS date in YYYYDDD form | | tm_to_ymd from struct tm, generate FIPS date in YYMMDD form | | tm_to_yymd from struct tm, generate FIPS date in YYYYMMDD form | | | | Routines that dynamically allocate struct tm and return its address: | | ymd_to_tm from FIPS date as YYMMDD or YYYYMMDD, make struct tm | | yd_to_tm from FIPS date as YYDDD or YYYYDDD, make struct tm | | get_tm from FIPS date and time (HHMM), make struct tm | | | | Routines that modify the time data passed by reference | | next_day modify struct tm by adding one day | | increment_yd modify FIPS date in YYDDD form by adding one day | | | | Peter N. Schweitzer (U.S. Geological Survey, Reston, VA 22092) | \*----------------------------------------------------------------------*/ extern size_t tm_to_yd (char *dst, const struct tm *tm); extern size_t tm_to_yyd (char *dst,const struct tm *tm); extern size_t tm_to_ymd (char *dst, const struct tm *tm); extern size_t tm_to_yymd (char *dst, const struct tm *tm); extern struct tm *ymd_to_tm (const char *ymd); extern struct tm *yd_to_tm (const char *yd); extern struct tm *get_tm (char *ds, char *ts); extern void next_day (struct tm *tm); extern void increment_yd (char *yyddd); /*----------------------------------------------------------------------*\ \*----------------------------------------------------------------------*/