The mktime() is an inbuilt C++ function which converts the local calendar time to the time since epoch and returns the value as an object of type time_t.
time_t mktime( struct tm *time_ptr )
Parameters: The function accepts a mandatory parameter pointer time_ptr that points to a tm object structure which contains a calendar time whihc is to be converted.
Return Value: The function returns two type of values as described below:
- It returns the time since epoch as an object of type time_t if the parameter passed is a success.
- It returns -1 on failure.
Below program illustrates the mktime() function:
Tha Day on 18th June 2018 was Monday
- Function Overloading vs Function Overriding in C++
- What happens when a virtual function is called inside a non-virtual function in C++
- log() function in C++
- exp() function C++
- div() function in C++
- fma() function in C++
- iswdigit() function in C/C++
- unordered_multiset end() function in C++ STL
- strtod() function in C/C++
- strcspn() function in C/C++
- strrchr() function in C/C++
- unordered_map end( ) function in C++ STL
- atexit() function in C/C++
- iswxdigit() function in C/C++
- towlower() function in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.