This language bar is your friend. Select your favorite languages!

Idiom #61 Get current date

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

import "time"
var d time.Time = time.Now()
#include <time.h>
time_t d=time(0);
DateTime d = DateTime.Now;
import std.datetime;
auto d = Clock.currTime;
var d = new;
d = :calendar.local_time
D = calendar:local_time().
d <- System.Posix.Time.epochTime
var d =;
var d = new Date();
import java.time.Instant;
Instant d =;
date =
time = os.time()
$d = time();
  _d: TDateTime;
  _d := Now;
$d = time;
import datetime
d =
d =
extern crate time;
let d = time::now();

Do you know the best way to do this in your language ?
New implementation...

Idiom created by