Featured image of post 如何在C++中以ISO8601格式输出当前时间

如何在C++中以ISO8601格式输出当前时间

前提条件

  • ISO C++ 20 标准 (/std:c++20)

代码

1
2
3
4
#include <chrono>
#include <format>

std::string datetime = std::format("{:%FT%TZ}", system_clock::now());

以上就是如何在C++中以ISO8601格式输出当前时间的方法。

参考

comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计