mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Document chrono
This commit is contained in:
@ -431,6 +431,10 @@ For example::
|
|||||||
|
|
||||||
The syntax is described in :ref:`chrono-specs`.
|
The syntax is described in :ref:`chrono-specs`.
|
||||||
|
|
||||||
|
.. doxygenfunction:: localtime(std::time_t)
|
||||||
|
|
||||||
|
.. doxygenfunction:: gmtime(std::time_t)
|
||||||
|
|
||||||
.. _compile-api:
|
.. _compile-api:
|
||||||
|
|
||||||
Format string compilation
|
Format string compilation
|
||||||
|
@ -288,7 +288,11 @@ inline null<> gmtime_r(...) { return null<>(); }
|
|||||||
inline null<> gmtime_s(...) { return null<>(); }
|
inline null<> gmtime_s(...) { return null<>(); }
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
// Thread-safe replacement for std::localtime
|
/**
|
||||||
|
Converts given time since epoch as ``std::time_t`` value into calendar time,
|
||||||
|
expressed in local time. Unlike ``std::localtime``, this function is
|
||||||
|
thread-safe on most platforms.
|
||||||
|
*/
|
||||||
inline std::tm localtime(std::time_t time) {
|
inline std::tm localtime(std::time_t time) {
|
||||||
struct dispatcher {
|
struct dispatcher {
|
||||||
std::time_t time_;
|
std::time_t time_;
|
||||||
@ -330,7 +334,11 @@ inline std::tm localtime(
|
|||||||
return localtime(std::chrono::system_clock::to_time_t(time_point));
|
return localtime(std::chrono::system_clock::to_time_t(time_point));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thread-safe replacement for std::gmtime
|
/**
|
||||||
|
Converts given time since epoch as ``std::time_t`` value into calendar time,
|
||||||
|
expressed in Coordinated Universal Time (UTC). Unlike ``std::gmtime``, this
|
||||||
|
function is thread-safe on most platforms.
|
||||||
|
*/
|
||||||
inline std::tm gmtime(std::time_t time) {
|
inline std::tm gmtime(std::time_t time) {
|
||||||
struct dispatcher {
|
struct dispatcher {
|
||||||
std::time_t time_;
|
std::time_t time_;
|
||||||
|
Reference in New Issue
Block a user