std::chrono...::utc_time)(3)

📦 version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

Bestie, this is the std::chrono...::utc_time)(3) page from the C++ Standard Libary manual — yes, that’s the exact spelling, don’t come for me 💅. It’s serving:

  • std::chrono::operator<<(std::chrono::utc_time) — the stream-output operator for utc_time, aka the thing that prints your UTC time into a stream.
  • std::chrono::operator<<(std::chrono::utc_time) — same iconic operator, listed again because that’s literally how the page says it, periodt ✨.

✨ Synopsis ✨

Defined in header <chrono>. The signature is this whole template situation, and it’s been around since C++20:

Defined in header <chrono>
template< class CharT, class Traits, class Duration >

std::basic_ostream<CharT, Traits>&                            (since
C++20)
    operator<<( std::basic_ostream<CharT, Traits>& os,

                const std::chrono::utc_time<Duration>& tp );

Okay so what it does: it outputs tp into the stream os, as if by os << std::format(os.getloc(), STATICALLY-WIDEN("{:L%F %T}"), tp), where STATICALLY_WIDEN<CharT>("{:L%F %T}") is "{:L%F %T}" if CharT is char, and L"{:L%F %T}" if CharT is wchar_t.

🫶 Return value 🫶

It returns os. That’s it. The stream comes back to you, bestie 🎀.

🩹 Defect reports 🩹

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • P2372R3 — Applied to: C++20. Behavior as published: “the given locale was used by default”. Correct behavior: “L is needed to use the given locale”.

🔭 See also 🔭

  • std::formatter<std::chrono::utc_time> — formatting support for utc_time (C++20) (class template specialization).
  • format — stores formatted representation of the arguments in a new string (C++20) (function template).

That’s the page, bestie! Source: http://cppreference.com, version/date: 2024.06.10, footer title: std::chrono...::utc_time)(3). Go off 👑💖

📦 where this page comes from