failed to set format string via arguments for zoned_time
M ZHA
1
Reputation point
the test code as below:
#include <iostream>
#include <chrono>
using namespace std::chrono;
int main()
{
zoned_time zt(current_zone(), system_clock::now());
std::cout << std::format("{:%T}", zt) << std::endl;
std::cout << std::format("{:{}}", zt, "%T") << std::endl;
}
the output:
22:50:48.6959767
2022-08-14 22:50:48.6959767 GMT+8
Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Sign in to answer