char *strptime(char *buf, const char *format, const struct tm *tm);
strptime() is the complementary function to strftime() and converts the character string pointed to by buf to a time value, which is stored in the tm structure pointed to by tm, using the format specified by format. format is a character string that consists of field descriptors and text characters, reminiscent of scanf(3). Each field descriptor consists of a % character followd by another character that specifies the replacement for the field descriptor. All other characters are copied from format into the result. The following field descriptors are supported:
Case is ignored when matching items such as month or weekday names.
The broken-down time structure tm is defined in <time.h> as follows:
struct tm
{
int tm_sec; /* seconds */
int tm_min; /* minutes */
int tm_hour; /* hours */
int tm_mday; /* day of the month */
int tm_mon; /* month */
int tm_year; /* year */
int tm_wday; /* day of the week */
int tm_yday; /* day in the year */
int tm_isdst; /* daylight saving time */
};
The return values point to static data, whose contents are overwritten by each call.
This function is only available in libraries newer than version 4.6.5. Linux libc4 and libc5 includes define the prototype unconditionally; glibc2 includes provide a prototype only when _XOPEN_SOURCE or _GNU_SOURCE are defined.
The function supports only those locales specified in locale(7)