Why does std::put_time not compile using multiple compilers?
问题 std::put_time does not seem to work. The following snippet is taken directly from en.cpp.reference.com. #include <iostream> #include <iomanip> #include <ctime> int main() { std::time_t t = std::time(nullptr); std::tm tm = *std::localtime(&t); std::cout.imbue(std::locale("ru_RU.utf8")); std::cout << "ru_RU: " << std::put_time(&tm, "%c %Z") << '\n'; std::cout.imbue(std::locale("ja_JP.utf8")); std::cout << "ja_JP: " << std::put_time(&tm, "%c %Z") << '\n'; } Several compilers agree that put_time