![]() |
VOOZH | about |
In order to facilitate finding the current local day, date, and time, C++ has defined several functions in the header file, so functions that will help us in achieving our objective of finding the local day, date, and time are: time():
Also, Calendar dates are displayed on the screen together with the day, date, and time that are current. All the date and time-related functions and variables in C++ are found in the ctime library.
It uses the argument of time(), which has the same value as the return value of time(), to fill a structure having date and time as its components, with corresponding time in the local timezone.
It is used to convert the contents in the structure filled by local time into a human-readable version which finally returns the day, date, and time in the given format:
Day Month Date hh:mm:ss Year
Example:
Current Day, Date and Time is = Thu Dec 29 06:35:15 2022