std::formatter<std::chrono::gps_time>
Min standard notice:
Header: <chrono>
Specialization of std::formatter that defines formatting rules for a std::chrono::gps_time.
# Declarations
template< class Duration, class CharT >
struct formatter<std::chrono::gps_time<Duration>, CharT>;
(since C++20)
# Example
#include <chrono>
#include <format>
#include <iostream>
int main()
{
std::chrono::time_point<std::chrono::utc_clock> epoch;
std::cout << std::format("The time of the Unix epoch was {0:%F}T{0:%R%z}.", epoch)
<< '\n';
}
# Defect reports
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| P2372R3 | C++20 | formatter used the global locale or passed locale | default “C” locale is used when L is absent |