std::chrono::local_t(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ NAME πŸŽ€

okay so this is the std::chrono::local_t(3) page from the C++ Standard Libary manual, and the NAME is literally std::chrono::local_t - std::chrono::local_t β€” iconic, no notes πŸ’….


✨ Synopsis ✨

Defined in header <chrono>:

struct local_t {};

(since C++20)

The class local_t is a pseudo-clock β€” yes bestie, that’s the actual term β€” and it’s used as the first template argument to std::chrono::time_point to indicate that the time point represents local time with respect of a not-yet-specified time zone. local_time supports streaming and the full set of time point arithmetic. slay 🫢.

πŸ¦‹ Time point family πŸ¦‹

Defined in namespace std::chrono:

template<class Duration>
using local_time = std::chrono::time_point<std::chrono::local_t, Duration>;

(since C++20)

  • using local_seconds = local_time<std::chrono::seconds>; β€” (since C++20)
  • using local_days = local_time<std::chrono::days>; β€” (since C++20)

the function-template + formatter crew, lowkey the main characters:

  • operator<<(std::chrono::local_time) β€” performs stream output on a local_time; (C++20) (function template) πŸ’–
  • from_stream(std::chrono::local_time) β€” parses a local_time from a stream according to the provided format; (C++20) (function template) ✨
  • std::formatter<std::chrono::local_time> β€” formatting support for local_time; (C++20) (class template specialization) 🌸

πŸ‘€ See also πŸ‘€

  • zoned_time β€” represents a time zone and a time point; (C++20) (class) πŸ”₯

signed off with love by http://cppreference.com on 2024.06.10 β€” this was the std::chrono::local_t(3) page, mwah πŸ’‹

πŸ“¦ where this page comes from