Logo

Programming-Idioms

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

Idiom #61 Get current date

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

(def d #(java.util.Date.))

Put the _. after java.util.Date in order to get an instance and not read it as a class. Need to declare d with an anonymous function _#() because the date can't be cast to Interface Function.
with Ada.Calendar;
D : Ada.Calendar.Time := Ada.Calendar.Clock;

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