[time.zone.zonedtime.ctor]

# 30 Time library [[time]](./#time)

## 30.11 Time zones [[time.zone]](time.zone#zonedtime.ctor)

### 30.11.7 Class template zoned_time [[time.zone.zonedtime]](time.zone.zonedtime#ctor)

#### 30.11.7.2 Constructors [time.zone.zonedtime.ctor]

[ð](#lib:zoned_time,constructor)

`zoned_time();
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9727)

*Constraints*: traits​::​default_zone() is a well-formed expression[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9731)

*Effects*: Initializes zone_ with traits​::​default_zone() and
default constructs tp_[.](#2.sentence-1)

[ð](#itemdecl:2)

`zoned_time(const sys_time<Duration>& st);
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9742)

*Constraints*: traits​::​default_zone() is a well-formed expression[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9746)

*Effects*: Initializes zone_ with traits​::​default_zone() and tp_ with st[.](#4.sentence-1)

[ð](#itemdecl:3)

`explicit zoned_time(TimeZonePtr z);
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9756)

*Preconditions*: z refers to a time zone[.](#5.sentence-1)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9760)

*Effects*: Initializes zone_ with std​::​move(z) and
default constructs tp_[.](#6.sentence-1)

[ð](#itemdecl:4)

`explicit zoned_time(string_view name);
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9771)

*Constraints*: traits​::​locate_zone(string_view{}) is a well-formed expression andzoned_time is constructible from the return type of traits​::​locate_zone(string_view{})[.](#7.sentence-1)

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9776)

*Effects*: Initializes zone_ with traits​::​locate_zone(name) and
default constructs tp_[.](#8.sentence-1)

[ð](#itemdecl:5)

`template<class Duration2>
  zoned_time(const zoned_time<Duration2, TimeZonePtr>& y);
`

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9788)

*Constraints*: is_convertible_v<sys_time<Duration2>, sys_time<Duration>> is true[.](#9.sentence-1)

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9792)

*Effects*: Initializes zone_ with y.zone_ and tp_ with y.tp_[.](#10.sentence-1)

[ð](#itemdecl:6)

`zoned_time(TimeZonePtr z, const sys_time<Duration>& st);
`

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9802)

*Preconditions*: z refers to a time zone[.](#11.sentence-1)

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9806)

*Effects*: Initializes zone_ with std​::​move(z) and tp_ with st[.](#12.sentence-1)

[ð](#itemdecl:7)

`zoned_time(string_view name, const sys_time<Duration>& st);
`

[13](#13)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9816)

*Constraints*: zoned_time is constructible from the return type of traits​::​locate_zone(name) and st[.](#13.sentence-1)

[14](#14)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9820)

*Effects*: Equivalent to construction with {traits​::​locate_zone(name), st}[.](#14.sentence-1)

[ð](#itemdecl:8)

`zoned_time(TimeZonePtr z, const local_time<Duration>& tp);
`

[15](#15)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9830)

*Constraints*: is_convertible_v<decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{})),
 sys_time<duration>> is true[.](#15.sentence-1)

[16](#16)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9839)

*Preconditions*: z refers to a time zone[.](#16.sentence-1)

[17](#17)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9843)

*Effects*: Initializes zone_ with std​::​move(z) and tp_ with zone_->to_sys(tp)[.](#17.sentence-1)

[ð](#itemdecl:9)

`zoned_time(string_view name, const local_time<Duration>& tp);
`

[18](#18)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9853)

*Constraints*: zoned_time is constructible from the return type of traits​::​locate_zone(name) and tp[.](#18.sentence-1)

[19](#19)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9857)

*Effects*: Equivalent to construction with {traits​::​locate_zone(name), tp}[.](#19.sentence-1)

[ð](#itemdecl:10)

`zoned_time(TimeZonePtr z, const local_time<Duration>& tp, choose c);
`

[20](#20)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9867)

*Constraints*: is_convertible_v<decltype(declval<TimeZonePtr&>()->to_sys(local_time<Duration>{}, choose::earliest)),
 sys_time<duration>> is true[.](#20.sentence-1)

[21](#21)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9876)

*Preconditions*: z refers to a time zone[.](#21.sentence-1)

[22](#22)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9880)

*Effects*: Initializes zone_ with std​::​move(z) and tp_ with zone_->to_sys(tp, c)[.](#22.sentence-1)

[ð](#itemdecl:11)

`zoned_time(string_view name, const local_time<Duration>& tp, choose c);
`

[23](#23)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9890)

*Constraints*: zoned_time is constructible from
the return type of traits​::​locate_zone(name), local_time<Duration>, and choose[.](#23.sentence-1)

[24](#24)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9895)

*Effects*: Equivalent to construction with {traits​::​locate_zone(name), tp, c}[.](#24.sentence-1)

[ð](#itemdecl:12)

`template<class Duration2, class TimeZonePtr2>
  zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& y);
`

[25](#25)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9906)

*Constraints*: is_convertible_v<sys_time<Duration2>, sys_time<Duration>> is true[.](#25.sentence-1)

[26](#26)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9910)

*Preconditions*: z refers to a valid time zone[.](#26.sentence-1)

[27](#27)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9914)

*Effects*: Initializes zone_ with std​::​move(z) and tp_ with y.tp_[.](#27.sentence-1)

[ð](#itemdecl:13)

`template<class Duration2, class TimeZonePtr2>
  zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& y, choose);
`

[28](#28)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9925)

*Constraints*: is_convertible_v<sys_time<Duration2>, sys_time<Duration>> is true[.](#28.sentence-1)

[29](#29)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9929)

*Preconditions*: z refers to a valid time zone[.](#29.sentence-1)

[30](#30)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9933)

*Effects*: Equivalent to construction with {z, y}[.](#30.sentence-1)

[31](#31)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9937)

[*Note [1](#note-1)*:

The choose parameter has no effect[.](#31.sentence-1)

â *end note*]

[ð](#itemdecl:14)

`template<class Duration2, class TimeZonePtr2>
  zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y);
`

[32](#32)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9949)

*Constraints*: zoned_time is constructible from
the return type of traits​::​locate_zone(name) and
the type zoned_time<Duration2, TimeZonePtr2>[.](#32.sentence-1)

[33](#33)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9955)

*Effects*: Equivalent to construction with {traits​::​locate_zone(name), y}[.](#33.sentence-1)

[ð](#itemdecl:15)

`template<class Duration2, class TimeZonePtr2>
  zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& y, choose c);
`

[34](#34)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9966)

*Constraints*: zoned_time is constructible from
the return type of traits​::​locate_zone(name),
the type zoned_time<Duration2, TimeZonePtr2>, and
the type choose[.](#34.sentence-1)

[35](#35)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9973)

*Effects*: Equivalent to construction with {traits​::​locate_zone(name), y, c}[.](#35.sentence-1)

[36](#36)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L9977)

[*Note [2](#note-2)*:

The choose parameter has no effect[.](#36.sentence-1)

â *end note*]
