Skip to main content

Datetime: now

The Datetime: now node function returns the current date and time as a Datetime object.

Parameters

TimezoneREQUIRED

The timezone in which you want the current date and time.

Formatter

Which format you want to render the date (see next section for available chars).

Output

Datetime
The datetime object.

Format option available:

SpecificationExampleDescriptionNotes
%Y2001The full proleptic Gregorian year, zero-padded to 4 digits.Supports years from -262144 to 262143. Years outside 1 BCE—9999 CE require an initial sign (+/-).
%C20The proleptic Gregorian year divided by 100, zero-padded to 2 digits.
%y01The proleptic Gregorian year modulo 100, zero-padded to 2 digits.
%q1Quarter of year (1-4).
%m07Month number (01–12), zero-padded to 2 digits.
%bJulAbbreviated month name. Always 3 letters.
%BJulyFull month name. Also accepts corresponding abbreviation in parsing.
%hJulSame as %b.
%d08Day number (01–31), zero-padded to 2 digits.
%e 8Same as %d but space-padded. Same as %_d.
%aSunAbbreviated weekday name. Always 3 letters.
%ASundayFull weekday name. Also accepts corresponding abbreviation in parsing.
%w0Weekday number: Sunday = 0, Monday = 1, …, Saturday = 6.
%u7Weekday number: Monday = 1, Tuesday = 2, …, Sunday = 7 (ISO 8601).
%U28Week number starting with Sunday (00–53), zero-padded to 2 digits.Week 1 starts with the first Sunday.
%W27Same as %U, but week 1 starts with the first Monday in that year instead.
%G2001Same as %Y but uses the year number in ISO 8601 week date.
%g01Same as %y but uses the year number in ISO 8601 week date.
%V27Week number in ISO 8601 week date (01–53).
%j189Day of the year (001–366), zero-padded to 3 digits.
%D07/08/01Month-day-year format. Same as %m/%d/%y.
%x07/08/01Locale’s date representation (e.g., 12/31/99).
%F2001-07-08Year-month-day format (ISO 8601). Same as %Y-%m-%d.
%v 8-Jul-2001Day-month-year format. Same as %e-%b-%Y.
%H00Hour number (00–23), zero-padded to 2 digits.
%k 0Same as %H but space-padded. Same as %_H.
%I12Hour number in 12-hour clocks (01–12), zero-padded to 2 digits.
%l12Same as %I but space-padded. Same as %_I.
%Pamam or pm in 12-hour clocks (lowercase).
%pAMAM or PM in 12-hour clocks (uppercase).
%M34Minute number (00–59), zero-padded to 2 digits.
%S60Second number (00–60), zero-padded to 2 digits.60 allows for a leap second.
%f26490000Number of nanoseconds since the last whole second.
%.f.026490Decimal fraction of a second (variable length), includes the leading dot.
%.3f.026Decimal fraction of a second with a fixed length of 3 (milliseconds).
%.6f.026490Decimal fraction of a second with a fixed length of 6 (microseconds).
%.9f.026490000Decimal fraction of a second with a fixed length of 9 (nanoseconds).
%3f026Decimal fraction of a second like %.3f but without the leading dot.
%6f026490Decimal fraction of a second like %.6f but without the leading dot.
%9f026490000Decimal fraction of a second like %.9f but without the leading dot.
%R00:34Hour-minute format. Same as %H:%M.
%T00:34:60Hour-minute-second format. Same as %H:%M:%S.
%X00:34:60Locale’s time representation (e.g., 23:13:48).
%r12:34:60 AMLocale’s 12 hour clock time.Falls back to %X if the locale does not have a 12 hour clock format.
%ZACSTLocal time zone name.Skips all non-whitespace characters during parsing. Identical to %:z when formatting.
%z+0930Offset from local time to UTC (without colon).UTC is +0000.
%:z+09:30Same as %z but with a colon.
%::z+09:30:00Offset with seconds included.
%:::z+09Offset without minutes/seconds.
%#z+09Parsing only: Same as %z but allows minutes to be missing or present.
%cSun Jul 8 00:34:60 2001Locale’s date and time.
%+2001-07-08T00:34:60.026490+09:30ISO 8601 / RFC 3339 date & time format.
%s994518299UNIX timestamp (seconds since 1970-01-01 00:00 UTC).
%tLiteral tab (\t).
%nLiteral newline (\n).
%%Literal percent sign (%).

Demo