There is a function available in C for converting a character string to a time value. The function is strptime().
This function is not present in string.h but the prototypes of this function is present in time.h and so one has to include <time.h> when using this function strptime().
The syntax of theis functions is given below:
char * strptime(const char *s,const char *f, struct tm *t);
The function strptime() what is does is it take the character string stored at pointed place of s and converts it using the using the format specified in the pointed f to the value stored in structured pointed by t. If the conversion was successful the function strptime() returns a character pointer and if the operation is not successful then a NULL pointer is returned.