Logo

Programming-Idioms

History of Idiom 61 > diff from v9 to v10

Edit summary for version 10 by :

Version 9

2015-08-20, 11:26:53

Version 10

2015-08-20, 16:59:49

Idiom #61 Get current date

Assign to variable d the current date/time value, in the most standard type.

Idiom #61 Get current date

Assign to variable d the current date/time value, in the most standard type.

Imports
import std.datetime;
Code
auto d = Clock.currTime;
Comments bubble
Returns the current date in the format "YYYY-Mon-DD HH:MM:SS.FFFFFFFTZ" where F is fractional seconds and TZ is the time zone.
Demo URL
http://dpaste.dzfl.pl/d474bfb0c9d8