27 Time library [time]

27.11 Time zones [time.zone]

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

27.11.7.2 Constructors [time.zone.zonedtime.ctor]

zoned_time();
Constraints: traits​::​default_­zone() is a well-formed expression.
Effects: Initializes zone_­ with traits​::​default_­zone() and default constructs tp_­.
zoned_time(const sys_time<Duration>& st);
Constraints: traits​::​default_­zone() is a well-formed expression.
Effects: Initializes zone_­ with traits​::​default_­zone() and tp_­ with st.
explicit zoned_time(TimeZonePtr z);
Preconditions: z refers to a time zone.
Effects: Initializes zone_­ with std​::​move(z) and default constructs tp_­.
explicit zoned_time(string_view name);
Constraints: 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: Initializes zone_­ with traits​::​locate_­zone(name) and default constructs tp_­.
template<class Duration2> zoned_time(const zoned_time<Duration2, TimeZonePtr>& y);
Constraints: is_­convertible_­v<sys_­time<Duration2>, sys_­time<Duration>> is true.
Effects: Initializes zone_­ with y.zone_­ and tp_­ with y.tp_­.
zoned_time(TimeZonePtr z, const sys_time<Duration>& st);
Preconditions: z refers to a time zone.
Effects: Initializes zone_­ with std​::​move(z) and tp_­ with st.
zoned_time(string_view name, const sys_time<Duration>& st);
Constraints: 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);
Preconditions: z refers to a time zone.
Constraints:
is_convertible_v<
  decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{})),
  sys_time<duration>>
is true.
Effects: Initializes zone_­ with std​::​move(z) and tp_­ with zone_­->to_­sys(tp).
zoned_time(string_view name, const local_time<Duration>& tp);
Constraints: 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);
Preconditions: z refers to a time zone.
Constraints:
is_convertible_v<
  decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{}, choose::earliest)),
  sys_time<duration>>
is true.
Effects: Initializes 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);
Constraints: 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);
Constraints: is_­convertible_­v<sys_­time<Duration2>, sys_­time<Duration>> is true.
Preconditions: z refers to a valid time zone.
Effects: Initializes 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);
Constraints: is_­convertible_­v<sys_­time<Duration2>, sys_­time<Duration>> is true.
Preconditions: z refers to a valid time zone.
Effects: Equivalent to construction with {z, y}.
Note
:
The choose parameter has no effect.
— end note
 ]
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y);
Constraints: zoned_­time is constructible from the return type of traits​::​locate_­zone(name) and the type zoned_­time<Duration2, TimeZonePtr2>.
Effects: Equivalent to construction with {traits​::​locate_­zone(name), y}.
template<class Duration2, class TimeZonePtr2> zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y, choose c);
Constraints: zoned_­time is constructible from the return type of traits​::​locate_­zone(name), the type zoned_­time<Duration2, TimeZonePtr2>, and the type choose.
Effects: Equivalent to construction with {traits​::​locate_­zone(name), y, c}.
Note
:
The choose parameter has no effect.
— end note
 ]