nowFormat ( string format , string _locale ) : string
Returns the date of today formatted.
See also
formatDatetimestamp
tansformDate
Parameters
format
The format of the date to be returned
yyyy-MM-dd HH:mm:ss
Example
yyyy-MM-dd HH:mm:ss
console(nowFormat("yyyy-MM-dd'T'HH:mm:ss'+01:00'")) // -> 2022-07-22T09:32:23+01:00
Symbol | Meaning | Presentation | Example |
---|---|---|---|
G | era designator | Text | AD |
y | year | Number | 2009 |
M | month in year | Text & Number | July & 07 |
d | day in month | Number | 10 |
h | hour in am/pm (1-12) | Number | 12 |
H | hour in day (0-23) | Number | 0 |
m | minute in hour | Number | 30 |
s | second in minute | Number | 55 |
S | millisecond | Number | 978 |
E | day in week | Text | Tuesday |
D | day in year | Number | 189 |
F | day of week in month | Number | 2 (2nd Wed in July) |
u | day of the week in number | Number | 3 (1 = Monday, 7 = Sunday) |
w | week in year | Number | 27 |
W | week in month | Number | 2 |
a | am/pm marker | Text | PM |
k | hour in day (1-24) | Number | 24 |
K | hour in am/pm (0-11) | Number | 0 |
z | time zone | Text | Pacific Standard Time |
escape for text Delimiter (none) | single quote | Literal (ex:yyyy 'year') |
_locale (optional)
Default:"en". The region corresponding to the desired format (useful especially for day or month texts). Language code (ex: "en", "fr", "it", "de", etc.)