29 Time library [time]

29.11 Time zones [time.zone]

29.11.7 Class template zoned_time [time.zone.zonedtime]

29.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);
Constraints: is_convertible_v< decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{})), sys_time<duration>> is true.
Preconditions: z refers to a time zone.
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);
Constraints: is_convertible_v< decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{}, choose::earliest)), sys_time<duration>> is true.
Preconditions: z refers to a time zone.
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 1: 
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 2: 
The choose parameter has no effect.
— end note]