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.
How to convert a character string to a time value?
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:
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.
Profile Answers by GeekAdmin Questions by GeekAdmin
Questions by GeekAdmin answers by GeekAdmin
Related Answered Questions
Related Open Questions