Вот код, который у меня есть:
Код: Выделить всё
std::string get_json(const std::chrono::time_point timestamp) {
std::string result = std::format(
"{{\r\n\"timestamp\": \"{%FT%T%z}\"\r\n}}",
timestamp
);
return result;
}
< /code>
\r\nСпецификаторы формата, по-видимому, отсутствуют для точностью субсекунды.
Код: Выделить всё
2025-03-08T19:54:00+0000
< /code>
rather than something which higher resolution such as
2025-03-08T19:54:00.123456+0000
< /code>
Is there a way to achieve formatting with higher resolution? Ideally microseconds or nanoseconds?
(Disclaimer: std::chrono::time_pointПодробнее здесь: https://stackoverflow.com/questions/794 ... -a-stdchro
Мобильная версия