From Jason Turner

[time.clock.system.nonmembers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp4kmsma5d/{from.md → to.md} +60 -0
tmp/tmp4kmsma5d/{from.md → to.md} RENAMED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Non-member functions <a id="time.clock.system.nonmembers">[[time.clock.system.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 sys_time<Duration>& tp);
7
+ ```
8
+
9
+ *Constraints:* `treat_as_floating_point_v<typename Duration::rep>` is
10
+ `false`, and `Duration{1} < days{1}` is `true`.
11
+
12
+ *Effects:* Equivalent to:
13
+
14
+ ``` cpp
15
+ auto const dp = floor<days>(tp);
16
+ return os << format(os.getloc(), STATICALLY-WIDEN<charT>("{} {}"),
17
+ year_month_day{dp}, hh_mm_ss{tp-dp});
18
+ ```
19
+
20
+ [*Example 1*:
21
+
22
+ ``` cpp
23
+ cout << sys_seconds{0s} << '\n'; // 1970-01-01 00:00:00
24
+ cout << sys_seconds{946'684'800s} << '\n'; // 2000-01-01 00:00:00
25
+ cout << sys_seconds{946'688'523s} << '\n'; // 2000-01-01 01:02:03
26
+ ```
27
+
28
+ — *end example*]
29
+
30
+ ``` cpp
31
+ template<class charT, class traits>
32
+ basic_ostream<charT, traits>&
33
+ operator<<(basic_ostream<charT, traits>& os, const sys_days& dp);
34
+ ```
35
+
36
+ *Effects:* `os << year_month_day{dp}`.
37
+
38
+ *Returns:* `os`.
39
+
40
+ ``` cpp
41
+ template<class charT, class traits, class Duration, class Alloc = allocator<charT>>
42
+ basic_istream<charT, traits>&
43
+ from_stream(basic_istream<charT, traits>& is, const charT* fmt,
44
+ sys_time<Duration>& tp, basic_string<charT, traits, Alloc>* abbrev = nullptr,
45
+ minutes* offset = nullptr);
46
+ ```
47
+
48
+ *Effects:* Attempts to parse the input stream `is` into the `sys_time`
49
+ `tp` using the format flags given in the NTCTS `fmt` as specified in
50
+ [[time.parse]]. If the parse fails to decode a valid date,
51
+ `is.setstate(ios_base::failbit)` is called and `tp` is not modified. If
52
+ `%Z` is used and successfully parsed, that value will be assigned to
53
+ `*abbrev` if `abbrev` is non-null. If `%z` (or a modified variant) is
54
+ used and successfully parsed, that value will be assigned to `*offset`
55
+ if `offset` is non-null. Additionally, the parsed offset will be
56
+ subtracted from the successfully parsed timestamp prior to assigning
57
+ that difference to `tp`.
58
+
59
+ *Returns:* `is`.
60
+