From Jason Turner

[time.clock.tai.nonmembers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp__gebla8/{from.md → to.md} +51 -0
tmp/tmp__gebla8/{from.md → to.md} RENAMED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Non-member functions <a id="time.clock.tai.nonmembers">[[time.clock.tai.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 tai_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 st = sys_days{2000y/January/1};
19
+ auto tt = clock_cast<tai_clock>(st);
20
+ cout << format("{0:%F %T %Z} == {1:%F %T %Z}\n", st, tt);
21
+ ```
22
+
23
+ Produces this output:
24
+
25
+ ``` text
26
+ 2000-01-01 00:00:00 UTC == 2000-01-01 00:00:32 TAI
27
+ ```
28
+
29
+ — *end example*]
30
+
31
+ ``` cpp
32
+ template<class charT, class traits, class Duration, class Alloc = allocator<charT>>
33
+ basic_istream<charT, traits>&
34
+ from_stream(basic_istream<charT, traits>& is, const charT* fmt,
35
+ tai_time<Duration>& tp, basic_string<charT, traits, Alloc>* abbrev = nullptr,
36
+ minutes* offset = nullptr);
37
+ ```
38
+
39
+ *Effects:* Attempts to parse the input stream `is` into the `tai_time`
40
+ `tp` using the format flags given in the NTCTS `fmt` as specified in
41
+ [[time.parse]]. If the parse fails to decode a valid date,
42
+ `is.setstate(ios_base::failbit)` is called and `tp` is not modified. If
43
+ `%Z` is used and successfully parsed, that value will be assigned to
44
+ `*abbrev` if `abbrev` is non-null. If `%z` (or a modified variant) is
45
+ used and successfully parsed, that value will be assigned to `*offset`
46
+ if `offset` is non-null. Additionally, the parsed offset will be
47
+ subtracted from the successfully parsed timestamp prior to assigning
48
+ that difference to `tp`.
49
+
50
+ *Returns:* `is`.
51
+