On Thursday, 30 June 2016 at 21:18:22 UTC, Luke Picardo wrote:

Why is it so hard to simply get the current date and time formatted properly in a string?

There are no examples of this in your documentation yet this is probably one of the most used cases.

To get the current time, use Clock.currTime. It will return the current time as a SysTime. To print it, toString is sufficient, but if using toISOString, toISOExtString, or toSimpleString, use the corresponding fromISOString, fromISOExtString, or fromSimpleString to create a SysTime from the string.

auto currentTime = Clock.currTime();
auto timeString = currentTime.toISOExtString();
auto restoredTime = SysTime.fromISOExtString(timeString);

Reply via email to