/*! \fn void ln_get_date_from_timet (time_t * t, struct ln_date * date) * \param t system time * \param date Pointer to new calendar date. * * Set date from system time */ void ln_get_date_from_timet (time_t * t, struct ln_date * date) { struct tm gmt; /* convert to UTC time representation */ gmtime_r (t, &gmt); ln_get_date_from_tm (&gmt, date); }
int extractISOTime(const char *timestr, struct ln_date *iso_date) { struct tm utm; if (strptime(timestr, "%Y/%m/%dT%H:%M:%S", &utm)) { ln_get_date_from_tm(&utm, iso_date); return (0); } if (strptime(timestr, "%Y-%m-%dT%H:%M:%S", &utm)) { ln_get_date_from_tm(&utm, iso_date); return (0); } return (-1); }
int extractISOTime(char *timestr, struct ln_date *iso_date) { #ifdef HAVE_NOVA_H struct tm utm; if (strptime(timestr, "%Y/%m/%dT%H:%M:%S", &utm)) { ln_get_date_from_tm(&utm, iso_date); return (0); } if (strptime(timestr, "%Y-%m-%dT%H:%M:%S", &utm)) { ln_get_date_from_tm(&utm, iso_date); return (0); } #endif return (-1); }