25 Time library [time]

25.10 Time zones [time.zone]

25.10.7 Class template zoned_­time [time.zone.zonedtime]

25.10.7.2 Constructors [time.zone.zonedtime.ctor]

zoned_time();
Remarks: This constructor does not participate in overload resolution unless traits::default_­zone() is a well-formed expression.
Effects: Constructs a zoned_­time by initializing zone_­ with traits::default_­zone() and default constructing tp_­.
zoned_time(const sys_time<Duration>& st);
Remarks: This constructor does not participate in overload resolution unless traits::default_­zone() is a well-formed expression.
Effects: Constructs a zoned_­time by initializing zone_­ with traits::default_­zone() and tp_­ with st.
explicit zoned_time(TimeZonePtr z);
Requires: z refers to a time zone.
Effects: Constructs a zoned_­time by initializing zone_­ with std::move(z).
explicit zoned_time(string_view name);
Remarks: This constructor does not participate in overload resolution unless traits::locate_­zone(string_­view{}) is a well-formed expression and zoned_­time is constructible from the return type of traits::locate_­zone(string_­view{}).
Effects: Constructs a zoned_­time by initializing zone_­ with traits::locate_­zone(name) and default constructing tp_­.
template<class Duration2> zoned_time(const zoned_time<Duration2, TimeZonePtr>& y) noexcept;
Remarks: Does not participate in overload resolution unless sys_­time<Duration2> is implicitly convertible to sys_­time<Duration>.
Effects: Constructs a zoned_­time by initializing zone_­ with y.zone_­ and tp_­ with y.tp_­.
zoned_time(TimeZonePtr z, const sys_time<Duration>& st);
Requires: z refers to a time zone.
Effects: Constructs a zoned_­time by initializing zone_­ with std::move(z) and tp_­ with st.
zoned_time(string_view name, const sys_time<Duration>& st);
Remarks: This constructor does not participate in overload resolution unless zoned_­time is constructible from the return type of traits::locate_­zone(name) and st.
Effects: Equivalent to construction with {traits::locate_­zone(name), st}.
zoned_time(TimeZonePtr z, const local_time<Duration>& tp);
Requires: z refers to a time zone.
Remarks: This constructor does not participate in overload resolution unless
decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{}))
is convertible to sys_­time<duration>.
Effects: Constructs a zoned_­time by initializing zone_­ with std::move(z) and tp_­ with zone_­->to_­sys(tp).
zoned_time(string_view name, const local_time<Duration>& tp);
Remarks: This constructor does not participate in overload resolution unless zoned_­time is constructible from the return type of traits::locate_­zone(name) and tp.
Effects: Equivalent to construction with {traits::locate_­zone(name), tp}.
zoned_time(TimeZonePtr z, const local_time<Duration>& tp, choose c);
Requires: z refers to a time zone.
Remarks: This constructor does not participate in overload resolution unless
decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{}, choose::earliest))
is convertible to sys_­time<duration>.
Effects: Constructs a zoned_­time by initializing zone_­ with std::move(z) and tp_­ with zone_­->to_­sys(tp, c).
zoned_time(string_view name, const local_time<Duration>& tp, choose c);
Remarks: This constructor does not participate in overload resolution unless zoned_­time is constructible from the return type of traits::locate_­zone(name), local_­time<Duration>, and choose.
Effects: Equivalent to construction with {traits::locate_­zone(name), tp, c}.
template<class Duration2, class TimeZonePtr2> zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& y);
Remarks: Does not participate in overload resolution unless sys_­time<Duration2> is implicitly convertible to sys_­time<Duration>.
Requires: z refers to a valid time zone.
Effects: Constructs a zoned_­time by initializing zone_­ with std::move(z) and tp_­ with y.tp_­.
template<class Duration2, class TimeZonePtr2> zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& y, choose);
Remarks: Does not participate in overload resolution unless sys_­time<Duration2> is implicitly convertible to sys_­time<Duration>.
Requires: z refers to a valid time zone.
Effects: Equivalent to construction with {z, y}.
[Note
:
The choose parameter has no effect.
end note
]
zoned_time(string_view name, const zoned_time<Duration>& y);
Remarks: This constructor does not participate in overload resolution unless zoned_­time is constructible from the return type of traits::locate_­zone(name) and zoned_­time.
Effects: Equivalent to construction with {traits::locate_­zone(name), y}.
zoned_time(string_view name, const zoned_time<Duration>& y, choose c);
Remarks: This constructor does not participate in overload resolution unless zoned_­time is constructible from the return type of traits::locate_­zone(name), zoned_­time, and choose.
Effects: Equivalent to construction with {traits::locate_­zone(name), y, c}.
[Note
:
The choose parameter has no effect.
end note
]