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:



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.

Questions by GeekAdmin   answers by GeekAdmin

Showing Answers 1 - 3 of 3 Answers

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions