The time function in the C++ standard library returns seconds elapsed since a specific, standardized date and time known as the epoch. While this value contains all of the information needed to calculate the current time and date of the system, writing your own epoch time translation code is error prone. Using the standard library’s provided time conversion functions makes this translation process trivial, allowing you to focus on the more complex portions of your application. time_t timeSinceEpoch = time(NULL); tm timeResult; timeResult = gmtime( &timeSinceEpoch ); Tips Warnings Writer Bio
