This page has migrated to https://helpdocs.conducttr.com/feature-documentation/designing/scenario-design/dynamic-content/functions/datetime-formatting
- be able to format date and
times
Summary
- timestamp = input; required, uses
the
format “yyyy-mm-dd hh:mm:ss”
- format = output format, e.g.
‘HH:mm:ss’
(see details)
- output timezone = timezone for
output;
optional, defaults to project’s
time
zone
(currently defaults to project
owner’s
time zone)
Formats
Below are the date-time formatting
specifications.
Format | Description |
W | number of the week in the
year
(Monday is the first day
of
the week) with leading
zero,
00-53 |
w | number of the week in the
year
(Sunday is the first day
of
the week) with leading
zero,
00-53 |
yy or YY | 2-digit year, e.g. 16 |
yyyy or YYYY | 4-digit year, e.g.
2016 |
M | number of the month without
leading zero, e.g. 1 |
MM | number of the month with
leading zero, e.g.
01 |
MMM | abbreviated month name,
e.g.
Jan |
MMMM | full month name, e.g.
January |
d or D | day of the month without
leading zero, e.g. 1 |
dd or DD | day of the month with
leading
zero, e.g. 01 |
ddd | abbreviated name of the day
of
the week, e.g. Sun |
dddd | full name of the day of the
week, e.g. Sunday |
h | hours (12-hr format)
without
leading zero |
hh | hours (12-hr format) with
leading zero |
H | hours (24-hr format)
without
leading zero |
HH | hours (24-hr format) with
leading zero |
mm | minutes |
ss | seconds |
SSSSSS | microseconds with leading
zeros, 000000-999999 |
p or tt | AM/PM label |
z or Z or TZD | time zone label, e.g.
UTC |
zz or ZZ | time zone offset without
colon,
e.g. +0100 |
zzz or ZZZ | time zone offset with
colon,
e.g. +01:00 |
Examples
The content body might
look like:
"You started at
|DATETIME(audience.start_time,
“HH:mm:ss”, “America/New_York”)| and
finished
at |DATETIME(audience.end_time,
“HH:mm:ss”,
“America/New_York”)|."
The example above shows the full-blown
version
with all the optional function parameters.
The
short one would look like:
"You started at
|datetime(audience.start_time)|
and finished at
|datetime(audience.end_time)|."
The second function parameter specifies the
date/time format, and the 3rd one
specifies
the time zone to use. The time zone can be
specified in 2 formats -
'America/New_York'
(this is a universally-accepted
representation
for US Eastern Time).
Other examples are
|datetime(audience.end_time, “d/M/yyyy,
ZZ,
HH:mm:ss”, audience.timezone)|
|datetime(audience.end_time, “HH:mm:ss Z
(ZZ)”, audience.timezone)|