What is the Current Time Around the World? -- Bartlomiej Filipek
In this blog post, we will explore handling dates using std::chrono, including time zones. We’ll utilize the latest features of the library to retrieve the current time across various time zones, taking into account daylight saving time changes as well. Additionally, we will incorporate new capabilities introduced in C++23, such as enhanced printing functions and more.
What is the Current Time Around the World? Utilizing std::chrono with Time Zones in C++23
by Bartlomiej Filipek
From the article:
Let’s start with the following code that prints the current date and time:
#include <chrono> #include <print> int main() { auto now = std::chrono::system_clock::now(); std::print("now is {}", now); }You can run it through Compiler Explorer
In my session, I’m getting the following results:
Now is 2024-11-01 11:44:06.374573703

Recent versions of the C++ language (C++20 and C++23) may allow you to change drastically how you program in C++. I want to provide some fun examples.
Programming at compile time has been possible in C++ for a long time. Wu Yongwei considers its past, present and future.
Probably the two most useful features added to C++20 are 
One of the reasons that I’m excited for Reflection in C++ is that it can permit you to implement, as a library, many things that previously required language features. In this post, I’m going to walk through implementing P2786R8 (“Trivial Relocatability For C++26”).
A post I wrote back in 2023