How to get current time and date in C++?
Is there a cross-platform way to get the current date and time in C++?
JOSHUA S.
answered 01/27/20
Software Engineer - C++ backend
Sure! I'd recommend looking at std::chrono library. https://en.cppreference.com/w/cpp/chrono
Just don't use high_resolution_clock, you should prefer steady_clock otherwise you won't have consistent results.
Still looking for help? Get the right answer, fast.
OR
Find an Online Tutor Now
Choose an expert and meet online.
No packages or subscriptions, pay only for the time you need.