I'm learning to use C++11 chrono, and am trying to output the time. Other SO questions show some code samples, e.g.
std::chrono::time_point<std::chrono::system_clock> now = std::chrono::system_clock::now();
std::time_t now_c = std::chrono::system_clock::to_time_t(now - std::chrono::hours(24));
std::cout << std::put_time(std::localtime(&now_c), "%F %T") << '\n';
When I run this on VS2012 in debug, I get a debug assert claiming I've used an "Invalid format directive".
The same happens if I use std::strftime
. I presume the %F
and %T
are not supported by Microsoft?
It is purely because %F and %T are not supported by Microsoft.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With