tmp/tmpihp7igzz/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Non-member functions <a id="time.clock.utc.nonmembers">[[time.clock.utc.nonmembers]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
template<class charT, class traits, class Duration>
|
| 5 |
+
basic_ostream<charT, traits>&
|
| 6 |
+
operator<<(basic_ostream<charT, traits>& os, const utc_time<Duration>& t);
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
*Effects:* Equivalent to:
|
| 10 |
+
|
| 11 |
+
``` cpp
|
| 12 |
+
return os << format(STATICALLY-WIDEN<charT>("{:%F %T}"), t);
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
[*Example 1*:
|
| 16 |
+
|
| 17 |
+
``` cpp
|
| 18 |
+
auto t = sys_days{July/1/2015} - 500ms;
|
| 19 |
+
auto u = clock_cast<utc_clock>(t);
|
| 20 |
+
for (auto i = 0; i < 8; ++i, u += 250ms)
|
| 21 |
+
cout << u << " UTC\n";
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
Produces this output:
|
| 25 |
+
|
| 26 |
+
``` text
|
| 27 |
+
2015-06-30 23:59:59.500 UTC
|
| 28 |
+
2015-06-30 23:59:59.750 UTC
|
| 29 |
+
2015-06-30 23:59:60.000 UTC
|
| 30 |
+
2015-06-30 23:59:60.250 UTC
|
| 31 |
+
2015-06-30 23:59:60.500 UTC
|
| 32 |
+
2015-06-30 23:59:60.750 UTC
|
| 33 |
+
2015-07-01 00:00:00.000 UTC
|
| 34 |
+
2015-07-01 00:00:00.250 UTC
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
— *end example*]
|
| 38 |
+
|
| 39 |
+
``` cpp
|
| 40 |
+
template<class charT, class traits, class Duration, class Alloc = allocator<charT>>
|
| 41 |
+
basic_istream<charT, traits>&
|
| 42 |
+
from_stream(basic_istream<charT, traits>& is, const charT* fmt,
|
| 43 |
+
utc_time<Duration>& tp, basic_string<charT, traits, Alloc>* abbrev = nullptr,
|
| 44 |
+
minutes* offset = nullptr);
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
*Effects:* Attempts to parse the input stream `is` into the `utc_time`
|
| 48 |
+
`tp` using the format flags given in the NTCTS `fmt` as specified in
|
| 49 |
+
[[time.parse]]. If the parse fails to decode a valid date,
|
| 50 |
+
`is.setstate(ios_base::failbit)` is called and `tp` is not modified. If
|
| 51 |
+
`%Z` is used and successfully parsed, that value will be assigned to
|
| 52 |
+
`*abbrev` if `abbrev` is non-null. If `%z` (or a modified variant) is
|
| 53 |
+
used and successfully parsed, that value will be assigned to `*offset`
|
| 54 |
+
if `offset` is non-null. Additionally, the parsed offset will be
|
| 55 |
+
subtracted from the successfully parsed timestamp prior to assigning
|
| 56 |
+
that difference to `tp`.
|
| 57 |
+
|
| 58 |
+
*Returns:* `is`.
|
| 59 |
+
|
| 60 |
+
``` cpp
|
| 61 |
+
struct leap_second_info {
|
| 62 |
+
bool is_leap_second;
|
| 63 |
+
seconds elapsed;
|
| 64 |
+
};
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
The type `leap_second_info` has data members and special members
|
| 68 |
+
specified above. It has no base classes or members other than those
|
| 69 |
+
specified.
|
| 70 |
+
|
| 71 |
+
``` cpp
|
| 72 |
+
template<class Duration>
|
| 73 |
+
leap_second_info get_leap_second_info(const utc_time<Duration>& ut);
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
*Returns:* A `leap_second_info` `lsi`, where `lsi.is_leap_second` is
|
| 77 |
+
`true` if `ut` is during a positive leap second insertion, and otherwise
|
| 78 |
+
`false`. `lsi.elapsed` is the sum of leap seconds between 1970-01-01 and
|
| 79 |
+
`ut`. If `lsi.is_leap_second` is `true`, the leap second referred to by
|
| 80 |
+
`ut` is included in the sum.
|
| 81 |
+
|