程式設計如何在 C++ 中以 ISO 8601 格式輸出當前時間先決條件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++ 中以 ISO 8601 格式輸出當前時間的方法。參考資料std::format