แก้ไข

แชร์ผ่าน


local_t struct

A pseudo-clock.

Syntax

struct local_t {}; // C++20

Remarks

Use this struct as an argument to the time_point template to indicate that a time_point represents local time. Specifying local_t doesn't specify the time zone of the local time.

As an example of how local_t is used, consider the declaration local_days ld{Sunday[1] / January / 2021}; This ultimately resolves to time_point<local_t, duration<long long>; where local_t indicates that the time_point represents local time.

Non-members

Name Description
from_stream Parse a local_time from the given stream using the specified format.
operator<< Output a local_time to the given stream.
Name Description
local_days A synonym for local_time<days>. Defined in std::chrono.
local_seconds A synonym for local_time<seconds>. Defined in std::chrono.
local_time A synonym for template <class Duration> using local_time = time_point<local_t, Duration>. Useful for representing a time_point for a local time. You specify the Duration. Defined in std::chrono.

Requirements

Header: <chrono> (since C++20)

Namespace: std::chrono

Compiler Option: /std:c++latest

See also

<chrono>
file_clock class
gps_clock class
high_resolution_clock
steady_clock struct
system_clock struct
tai_clock class
Header Files Reference