On Thursday, 18 January 2024 at 23:26:42 UTC, zoujiaqing wrote:
```D
import std.datetime : Clock, format;
import std.stdio : writeln;

void main()
{
    auto currentTime = Clock.currTime;

auto formattedTime = currentTime.format("%Y-%m-%d %H:%M:%S");

    writeln("Formatted Time: ", formattedTime);
}
```

C++ Std library exmaple code:
```CPP
// 2019-12-20 19:35:12
std::cout << std::put_time(locNow, "%Y-%m-%d %H:%M:%S") << std::endl;
```

Reply via email to