4 ms·
Among the many improvements, time is one area where C++ has become better than old school C cruft. In c++20/std::chrono, the Lua like code is just this - aut
by npalli 2y ago
Among the many improvements, time is one area where C++ has become better than old school C cruft. In c++20/std::chrono, the Lua like code is just this -
auto now = system_clock::now();
zoned_time local_time{current_zone(), now};
std::cout << std::format("{:%a %b %d %T}\n", local_time);
- burntsushi 2y agoOr Rust, with Jiff: println!("{}", jiff::Zoned::now().strftime("%a %b %d %T"));
- pjmlp 2y agoSome C++23 flavour, :) auto now = system_clock::now(); zoned_time local_time{current_zone(), now}; std::println("{:%a %b %d %T}", local_time);