mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-16 20:41:20 +08:00
Add convenience converts among sys_time, utc_time, tai_time, and gps_time.
This commit is contained in:
parent
58b08e0c74
commit
49f4ef0a2c
70
tz.html
70
tz.html
@ -26,7 +26,7 @@
|
||||
<br/>
|
||||
<br/>
|
||||
<a href="mailto:howard.hinnant@gmail.com">Howard E. Hinnant</a><br/>
|
||||
2016-06-07<br/>
|
||||
2016-06-08<br/>
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"> <img alt="Creative
|
||||
Commons License" style="border-width:0"
|
||||
src="http://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br /> This work is licensed
|
||||
@ -2695,6 +2695,74 @@ operator<<(std::basic_ostream<class CharT, class Traits>& os, co
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<p><b>Convenience converters</b></p>
|
||||
|
||||
<pre>
|
||||
template <class Duration>
|
||||
sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
|
||||
to_sys_time(tai_time<Duration> t)
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>to_sys_time(to_utc_time(t))</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class Duration>
|
||||
sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
|
||||
to_sys_time(gps_time<Duration> t)
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>to_sys_time(to_utc_time(t))</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class Duration>
|
||||
tai_time<typename std::common_type<Duration, std::chrono::seconds>::type>
|
||||
to_tai_time(sys_time<Duration> t)
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>to_tai_time(to_utc_time(t))</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class Duration>
|
||||
tai_time<typename std::common_type<Duration, std::chrono::seconds>::type>
|
||||
to_tai_time(gps_time<Duration> t)
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>to_tai_time(to_utc_time(t))</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class Duration>
|
||||
gps_time<typename std::common_type<Duration, std::chrono::seconds>::type>
|
||||
to_gps_time(sys_time<Duration> t)
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>to_gps_time(to_utc_time(t))</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<pre>
|
||||
template <class Duration>
|
||||
gps_time<typename std::common_type<Duration, std::chrono::seconds>::type>
|
||||
to_gps_time(tai_time<Duration> t)
|
||||
</pre>
|
||||
<blockquote>
|
||||
<p>
|
||||
<i>Returns:</i> <code>to_gps_time(to_utc_time(t))</code>.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<p>
|
||||
[<i>Example:</i>
|
||||
</p>
|
||||
|
Loading…
x
Reference in New Issue
Block a user