•Date and Time
•DateTimeNow
Gets the current UTC date time. Uses specific format if provided.
•Input parameters
•Output parameters
now
(Text)
- Returns a text value that represents the current date and/or time.
•Example
format: 'MM-dd-yyyy HH:mm'
output: { 'now': '12-07-2022 06:30' }
format: 'MM-dd-yyyy HH:mm'
output: { 'now': '12-07-2022 06:30' }
•DateTimeParse
Converts the string representation of a date and time to its ISO format equivalent using the specified format. The format of the string representation must match a specified format exactly.
•Input parameters
•Output parameters
date
(Text)
- Returns an ISO formatted date or nil
.
•Example
dt_string: '22 12 7 05:57:00'
format: 'yy MM d HH:mm:ss'
output: { 'date': '2022-12-07T05:57:00.000Z' }
dt_string: '22 12 7 05:57:00'format: 'yy MM d HH:mm:ss'
output: { 'date': '2022-12-07T05:57:00.000Z' }
•DateTimeParse
Used to format DateTime strings.
•Input parameters
•Output parameters
date
(Text)
- Returns an ISO formatted date or nil
.
•Example
date: '2022-12-07 00:00:00'
format: 'yyyyMMdd'
output: { 'date': '20221207' }
date: '2022-12-07 00:00:00'format: 'yyyyMMdd'
output: { 'date': '20221207' }
•Formats
You could use the following formatting rules(date and time functions are written in Swift). Experiment and play around with the dates and times here.
•Year
Characters | Example | Description |
---|
y | 2022 | Year, no padding |
yy | 22 | Year, two digits (padding with a zero if necessary) |
yyyy | 2022 | Year, minimum of four digits (padding with zeros if necessary) |
•Quarter
Characters | Example | Description |
---|
Q | 4 | The quarter of the year. Use QQ if you want zero padding. |
QQQ | Q4 | Quarter including "Q" |
QQQQ | 4th quarter | Quarter spelled out |
•Month
Characters | Example | Description |
---|
M | 12 | The numeric month of the year. A single M will use '1' for January. |
MM | 12 | The numeric month of the year. A double M will use '01' for January. |
MMM | Dec | The shorthand name of the month |
MMMM | December | Full name of the month |
MMMMM | D | Narrow name of the month |
•Month
Characters | Example | Description |
---|
M | 12 | The numeric month of the year. A single M will use '1' for January. |
MM | 12 | The numeric month of the year. A double M will use '01' for January. |
MMM | Dec | The shorthand name of the month |
MMMM | December | Full name of the month |
MMMMM | D | Narrow name of the month |
•Day
Characters | Example | Description |
---|
d | 14 | The day of the month. A single d will use 1 for January 1st. |
dd | 14 | The day of the month. A double d will use 01 for January 1st. |
F | 2 | (numeric) The day of week in the month. |
E | Tue | The abbreviation for the day of the week |
EEEE | Tuesday | The wide name of the day of the week |
EEEEE | T | The narrow day of week |
EEEEEE | Tu | The short day of week |
•Hour
Characters | Example | Description |
---|
h | 4 | The 12-hour hour. |
hh | 04 | The 12-hour hour padding with a zero if there is only 1 digit |
H | 16 | The 24-hour hour. |
HH | 16 | The 24-hour hour padding with a zero if there is only 1 digit. |
a | PM | AM / PM for 12-hour time formats |
•Minute
Characters | Example | Description |
---|
m | 35 | The minute, with no padding for zeroes. |
mm | 35 | The minute with zero padding. |
•Second
Characters | Example | Description |
---|
s | 8 | The seconds, with no padding for zeroes. |
ss | 08 | The seconds with zero padding. |
SSS | 123 | The milliseconds. |
•Second
Characters | Example | Description |
---|
zzz | CST | The 3 letter name of the time zone. Falls back to GMT-08:00 (hour offset) if the name is not known. |
zzzz | Central Standard Time | The expanded time zone name, falls back to GMT-08:00 (hour offset) if name is not known. |
ZZZZ | CST-06:00 | Time zone with abbreviation and offset |
Z | -0600 | RFC 822 GMT format. Can also match a literal Z for Zulu (UTC) time. |
ZZZZZ | -06:00 | ISO 8601 time zone format |