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);