Reference · Dates
date.now
date.now(str | null=) -> strWhat it does
The date and time now, to the second, as RFC 3339 text: "2026-10-27T14:30:00Z" in
UTC. With a time zone (an IANA name, "UTC", or an offset like "+05:30" or "+0530";
see date.valid_zone) it is the
same instant written at that zone's offset, "2026-10-27T15:30:00+01:00". It reads the
clock, so it is the time effect, and a script run with run_script does without it.
For milliseconds as an int, use now.
Examples
let t = date.now()print(len(t), type_of(t), date.valid(t, "date-time"))print(ends_with(t, "Z"), date.date_in(t) == date.today())20 str truetrue trueEdge cases
- There are no fractions of a second: the text is always 20 characters in UTC.
- An offset of zero is written
Z, never+00:00. - In a named zone the offset follows daylight saving: Paris is
+01:00or+02:00depending on the day. date.msof the result never passesnow()read right after it: the two read the same clock, one to the second, the other to the millisecond.
let paris = date.now("Europe/Paris")print(len(paris), ends_with(paris, "+01:00") || ends_with(paris, "+02:00"))print(date.now("+05:30") | ends_with("+05:30"), date.now(null) | ends_with("Z"))print(date.ms(date.now()) <= now())25 truetrue truetrueErrors
A zone that is not a string, or one the time zone database does not know, is a runtime error, not an error value.
print(date.now("Europe/Nowhere"))line 1: `date.now`: unknown time zone "Europe/Nowhere"Chaining
print(date.now() | date.date_in("Asia/Tokyo") | date.valid("date"))print(date.now() | date.to_zone("America/New_York") | date.parts | keys)true["year", "month", "day", "weekday", "hour", "minute", "second", "offset"]See also
date.today, now, date.to_zone, date.date_in, date.ms, date.format
Thread 0 posts
On date.now(): questions, tips, corrections, and code that uses it.
No posts yet. The first one opens the thread.
Edit this page on GitHub · every example's output was made by running it (tools/refcheck.mjs) · questions on Discord or r/quillo