tmp/tmpzbg94p5n/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Class `time_zone` <a id="time.zone.timezone">[[time.zone.timezone]]</a>
|
| 2 |
+
|
| 3 |
+
#### Overview <a id="time.zone.overview">[[time.zone.overview]]</a>
|
| 4 |
+
|
| 5 |
+
``` cpp
|
| 6 |
+
namespace std::chrono {
|
| 7 |
+
class time_zone {
|
| 8 |
+
public:
|
| 9 |
+
time_zone(time_zone&&) = default;
|
| 10 |
+
time_zone& operator=(time_zone&&) = default;
|
| 11 |
+
|
| 12 |
+
// unspecified additional constructors
|
| 13 |
+
|
| 14 |
+
string_view name() const noexcept;
|
| 15 |
+
|
| 16 |
+
template<class Duration> sys_info get_info(const sys_time<Duration>& st) const;
|
| 17 |
+
template<class Duration> local_info get_info(const local_time<Duration>& tp) const;
|
| 18 |
+
|
| 19 |
+
template<class Duration>
|
| 20 |
+
sys_time<common_type_t<Duration, seconds>>
|
| 21 |
+
to_sys(const local_time<Duration>& tp) const;
|
| 22 |
+
|
| 23 |
+
template<class Duration>
|
| 24 |
+
sys_time<common_type_t<Duration, seconds>>
|
| 25 |
+
to_sys(const local_time<Duration>& tp, choose z) const;
|
| 26 |
+
|
| 27 |
+
template<class Duration>
|
| 28 |
+
local_time<common_type_t<Duration, seconds>>
|
| 29 |
+
to_local(const sys_time<Duration>& tp) const;
|
| 30 |
+
};
|
| 31 |
+
}
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
A `time_zone` represents all time zone transitions for a specific
|
| 35 |
+
geographic area. `time_zone` construction is unspecified, and performed
|
| 36 |
+
as part of database initialization.
|
| 37 |
+
|
| 38 |
+
[*Note 1*: `const time_zone` objects can be accessed via functions such
|
| 39 |
+
as `locate_zone`. — *end note*]
|
| 40 |
+
|
| 41 |
+
#### Member functions <a id="time.zone.members">[[time.zone.members]]</a>
|
| 42 |
+
|
| 43 |
+
``` cpp
|
| 44 |
+
string_view name() const noexcept;
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
*Returns:* The name of the `time_zone`.
|
| 48 |
+
|
| 49 |
+
[*Example 1*: `"America/New_York"`. — *end example*]
|
| 50 |
+
|
| 51 |
+
``` cpp
|
| 52 |
+
template<class Duration>
|
| 53 |
+
sys_info get_info(const sys_time<Duration>& st) const;
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
*Returns:* A `sys_info` `i` for which `st` is in the range \[`i.begin`,
|
| 57 |
+
`i.end`).
|
| 58 |
+
|
| 59 |
+
``` cpp
|
| 60 |
+
template<class Duration>
|
| 61 |
+
local_info get_info(const local_time<Duration>& tp) const;
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
*Returns:* A `local_info` for `tp`.
|
| 65 |
+
|
| 66 |
+
``` cpp
|
| 67 |
+
template<class Duration>
|
| 68 |
+
sys_time<common_type_t<Duration, seconds>>
|
| 69 |
+
to_sys(const local_time<Duration>& tp) const;
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
*Returns:* A `sys_time` that is at least as fine as `seconds`, and will
|
| 73 |
+
be finer if the argument `tp` has finer precision. This `sys_time` is
|
| 74 |
+
the UTC equivalent of `tp` according to the rules of this `time_zone`.
|
| 75 |
+
|
| 76 |
+
*Throws:* If the conversion from `tp` to a `sys_time` is ambiguous,
|
| 77 |
+
throws `ambiguous_local_time`. If the `tp` represents a non-existent
|
| 78 |
+
time between two UTC `time_points`, throws `nonexistent_local_time`.
|
| 79 |
+
|
| 80 |
+
``` cpp
|
| 81 |
+
template<class Duration>
|
| 82 |
+
sys_time<common_type_t<Duration, seconds>>
|
| 83 |
+
to_sys(const local_time<Duration>& tp, choose z) const;
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
*Returns:* A `sys_time` that is at least as fine as `seconds`, and will
|
| 87 |
+
be finer if the argument `tp` has finer precision. This `sys_time` is
|
| 88 |
+
the UTC equivalent of `tp` according to the rules of this `time_zone`.
|
| 89 |
+
If the conversion from `tp` to a `sys_time` is ambiguous, returns the
|
| 90 |
+
earlier `sys_time` if `z == choose::earliest`, and returns the later
|
| 91 |
+
`sys_time` if `z == choose::latest`. If the `tp` represents a
|
| 92 |
+
non-existent time between two UTC `time_points`, then the two UTC
|
| 93 |
+
`time_points` will be the same, and that UTC `time_point` will be
|
| 94 |
+
returned.
|
| 95 |
+
|
| 96 |
+
``` cpp
|
| 97 |
+
template<class Duration>
|
| 98 |
+
local_time<common_type_t<Duration, seconds>>
|
| 99 |
+
to_local(const sys_time<Duration>& tp) const;
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
*Returns:* The `local_time` associated with `tp` and this `time_zone`.
|
| 103 |
+
|
| 104 |
+
#### Non-member functions <a id="time.zone.nonmembers">[[time.zone.nonmembers]]</a>
|
| 105 |
+
|
| 106 |
+
``` cpp
|
| 107 |
+
bool operator==(const time_zone& x, const time_zone& y) noexcept;
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
*Returns:* `x.name() == y.name()`.
|
| 111 |
+
|
| 112 |
+
``` cpp
|
| 113 |
+
strong_ordering operator<=>(const time_zone& x, const time_zone& y) noexcept;
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
*Returns:* `x.name() <=> y.name()`.
|
| 117 |
+
|