![]() |
VOOZH | about |
The ctime() function is define in the time.h header file. The ctime() function returns the string representing the localtime based on the argument timer.
Syntax:
char *ctime(const time_t *timer)
Parameters: This function accepts single parameter time_ptr. It is used to set time_t object that contains a time value.
Return Value: This function returns a string that contains the date and time which is in human readable form.
Example:
Www Mmm dd hh:mm:ss yyyy
Time Complexity: O(1)
Auxiliary Space: O(1)
Note: The description of results are given below:
Example:
Output:
One hour from now, the date and time will be: Thu Apr 13 09:01:46 2023