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++
- div() function in C++
- fma() function in C++
- exp() function C++
- log() function in C++
- acos() function in C++ STL
- sinh() function in C++ STL
- acosh() function in C++ STL
- asinh() function in C++ STL
- set value_comp() function in C++ STL
- cosh() function in C++ STL
- tanh() function in C++ STL
- negate function in C++ STL
- lldiv() function in C++ STL
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.