STRPTIME(3)

NAME
strptime - parse date and time string

SYNOPSIS
#include <time.h>
const char *
strptime(const char *buf, const char *format, struct tm *timeptr);

DESCRIPTION
The strptime() function parses the string in the buffer buf according to the string pointed to by format, and fills in the elements of the structure pointed to by timeptr. Thus, it can be considered the reverse operation of strftime(3).

The format string consists of zero or more conversion specifications and ordinary characters. All ordinary characters are matched exactly with the buffer, where white space in the format string will match any amount of white space in the buffer. All conversion specifications are identical to those described in strftime(3).

RETURN VALUES
Upon successful completion, strptime() returns the pointer to the first character in buf that has not been required to satisfy the specified conversions in format. It returns NULL if one of the conversions failed.

SEE ALSO
date(1), scanf(3), strftime(3)

AUTHORS
The strptime() function has been contributed by Powerdog Industries.

This man page was written by Joerg Wunsch.

HISTORY
The strptime() function appeared in FreeBSD 3.0.