std::chrono::system_clock - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::chrono::system_clock

From cppreference.com
< cpp‎ | chrono

Defined in header `<chrono>` |  |
class system_clock; |  | (since C++11)

Class `std::chrono::system_clock` represents the system-wide real time wall clock.

It may not be monotonic: on most systems, the system time can be adjusted at any moment. It is the only C++ clock that has the ability to map its time points to C-style time, and, therefore, to be displayed.

`std::chrono::system_clock` meets the requirements of `TrivialClock`.

### [edit] Member types

Member type | Definition
`rep` | signed arithmetic type representing the number of ticks in the clock's duration
`period` | an std::ratio type representing the tick period of the clock, in seconds
`duration` | std::chrono::duration<rep, period>, capable of representing negative durations
`time_point` | std::chrono::time_point<std::chrono::system_clock>

### [edit] Member constants

constexpr bool is_steady [static] | true if the time between ticks is always constant, i.e. calls to `now()` return values that increase monotonically even in case of some external clock adjustment (public static member constant)

### [edit] Member functions

now [static] | returns a std::chrono::time_point representing the current point in time (public static member function) [edit]
to_time_t [static] | converts a system clock time point to std::time_t (public static member function) [edit]
from_time_t [static] | converts std::time_t to a system clock time point (public static member function) [edit]

### [edit] See also

steady_clock (C++11) | monotonic clock that will never be adjusted (class)
high_resolution_clock (C++11) | the clock with the shortest tick period available (class)

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/chrono/system_clock&oldid=64486"