std::chrono..._clock::now(3)
π NAME π
okay so bestie, welcome to std::chrono..._clock::now(3) from the C++ Standard Libary manual β yes, that's the manual name up top, we're folding it in here instead of copying the whole header line. and the NAME tea is exactly this:
std::chrono::system_clock::now - std::chrono::system_clock::now
β¨ Synopsis β¨
static std::chrono::time_point<std::chrono::system_clock> now()
(since C++11)
noexcept;
Returns a time point representing the current point in time. that's it, that's the whole little synopsis moment. β¨
πΈ Parameters πΈ
literally (none) β no arguments, no secret bonus params, just a clean little call. π«Ά
π Return value π
A time point representing the current time. yes bestie, it gives you the current time as a time point. π
π¦ Example π¦
// Run this code
#include <chrono>
#include <iostream>
int main()
{
const auto now = std::chrono::system_clock::now();
const std::time_t t_c = std::chrono::system_clock::to_time_t(now);
std::cout << "The system clock is currently at " <<
std::ctime(&t_c);
}
π Possible output: π
The system clock is currently at Thu Mar 30 13:28:27 2023
π source/version + date: http://cppreference.com, 2024.06.10 β that's the footer tea, and this page is officially done. mwah, bye bestie! π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms