Logo

Programming-Idioms

  • Rust
  • Elixir

Idiom #61 Get current date

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

d = :calendar.local_time
extern crate time;
let d = time::now();

The current time in the local timezone in this format: http://doc.rust-lang.org/time/time/struct.Tm.html
use std::time::SystemTime;
let d = SystemTime::now();
with Ada.Calendar;
D : Ada.Calendar.Time := Ada.Calendar.Clock;

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