Get the current date and time

From Cuis CookBook
Revision as of 20:24, 4 May 2025 by Nmingott (talk | contribs) (imported material)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Date

One can obtain the current date, represented as an instance of Date, like this:

Date today.   "=> 15 August 2021 "

Time

The time of the day, as an instance of Time, can be obtained like this::

Time now.      "=> 3:15:04.483133 pm "

Both Date and Time in one go

A timestamp including the time and the date, an instance of DateAndTime, can obtained like this

DateAndTime now.    "=> 2021-08-15T15:15:26.957885+00:00 "