---
name: "std::literals::chrono_literals"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::literals::chrono_literals"
---

# std::literals::chrono\_literals(3)

## NAME

std::literals::chrono\_literals

## SYNOPSIS

### Functions

constexpr chrono::day **operator''d** (unsigned long long \_\_d) noexcept\
 Literal suffix for creating chrono::day objects.  template\<char... \_Digits\> constexpr **chrono::hours** **operator''h** ()\
 Literal suffix for durations of type std::chrono::hours.  constexpr **chrono::duration**\< long double, **ratio**\< 3600, 1 \> \> **operator''h** (long double \_\_hours)\
 Literal suffix for durations representing non-integer hours.  template\<char... \_Digits\> constexpr **chrono::minutes** **operator''min** ()\
 Literal suffix for durations of type std::chrono::minutes.  constexpr **chrono::duration**\< long double, **ratio**\< 60, 1 \> \> **operator''min** (long double \_\_mins)\
 Literal suffix for durations representing non-integer minutes.  template\<char... \_Digits\> constexpr **chrono::milliseconds** **operator''ms** ()\
 Literal suffix for durations of type std::chrono::milliseconds.  constexpr **chrono::duration**\< long double, milli \> **operator''ms** (long double \_\_msecs)\
 Literal suffix for durations representing non-integer milliseconds.  template\<char... \_Digits\> constexpr **chrono::nanoseconds** **operator''ns** ()\
 Literal suffix for durations of type std::chrono::nanoseconds.  constexpr **chrono::duration**\< long double, nano \> **operator''ns** (long double \_\_nsecs)\
 Literal suffix for durations representing non-integer nanoseconds.  template\<char... \_Digits\> constexpr **chrono::seconds** **operator''s** ()\
 Literal suffix for durations of type std::chrono::seconds.  constexpr **chrono::duration**\< long double \> **operator''s** (long double \_\_secs)\
 Literal suffix for durations representing non-integer seconds.  template\<char... \_Digits\> constexpr **chrono::microseconds** **operator''us** ()\
 Literal suffix for durations of type std::chrono::microseconds.  constexpr **chrono::duration**\< long double, micro \> **operator''us** (long double \_\_usecs)\
 Literal suffix for durations representing non-integer microseconds.  constexpr chrono::year **operator''y** (unsigned long long \_\_y) noexcept\
 Literal suffix for creating chrono::year objects.

## Detailed Description

ISO C++ 2014 namespace for suffixes for duration literals.

These suffixes can be used to create chrono::duration values with tick periods of hours, minutes, seconds, milliseconds, microseconds or nanoseconds. For example, std::chrono::seconds(5) can be written as 5s after making the suffix visible in the current scope. The suffixes can be made visible by a using-directive or using-declaration such as:

- •

  using namespace std::chrono\_literals;

- •

  using namespace std::literals;

- •

  using namespace std::chrono;

- •

  using namespace std;

- •

  using std::chrono\_literals::operator""s;

The result of these suffixes on an integer literal is one of the standard typedefs such as std::chrono::hours. The result on a floating-point literal is a duration type with the specified tick period and an unspecified floating-point representation, for example 1.5e2ms might be equivalent to chrono::duration\<long double, chrono::milli\>(1.5e2).

**Since**

C++14

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
