Logo

Programming-Idioms

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

Idiom #61 Get current date

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

import "time"
d := time.Now()

The type Time wraps a timestamp with nanosecond precision.
with Ada.Calendar;
D : Ada.Calendar.Time := Ada.Calendar.Clock;

New implementation...
< >
programming-idioms.org