Guide to Format Dates inside of Messages

If you are using date data type in a lead data field. You can consider using the following format short codes to format and display a dynamic date and time in your message.

For example if you have a lead data field called [appointment_date] which is of date data type and you write it in your chat message it would look like the following.

Dear Customer, 
Your appointment has been confirmed on [appointment_date].

Outcome

Dear Customer, 
Your appointment has been confirmed on 2023-11-06t00:00:00.000.

The outcome is un-formatted and looks rather technical.

Where as if you wish to print this date in a more human friendly format, you may consider using the following expression.

date([appointment_date],ff)

This can be used in your message as follows:

Dear Customer, 
Your appointment has been confirmed on date([appointment_date],ff).

Outcome

Dear Customer, Your appointment has been confirmed on Nov 6, 2023, 12:00 AM.

Here the result is more natural and easy to understand, also this gives you the flexibility to customize the format of date, just the way like to.

In the above example "ff" short code represents the formatting in which you would like to display the date. instead of "ff", if you use "F", it would return a different date format which would look like 11/6/2023, 12:00:00 AM. You can refer to the following table for different Format Short Codes to achieve a date and time format of your choice.

Format Short CodesDescriptionExample
Smillisecond, no padding54
SSSmillisecond, padded to 3054
ufractional seconds, functionally identical to SSS054
uufractional seconds, between 0 and 99, padded to 205
uuufractional seconds, between 0 and 90
ssecond, no padding4
sssecond, padded to 2 padding04
mminute, no padding7
mmminute, padded to 207
hhour in 12-hour time, no padding1
hhhour in 12-hour time, padded to 201
Hhour in 24-hour time, no padding9
HHhour in 24-hour time, padded to 213
Znarrow offset+5
ZZshort offset+05:00
ZZZtechie offset+0500
ZZZZabbreviated named offsetEST
ZZZZZunabbreviated named offsetEastern Standard Time
zIANA zoneAmerica/New_York
ameridiemAM
dday of the month, no padding6
ddday of the month, padded to 206
cday of the week, as number from 1-7 (Monday is 1, Sunday is 7)3
cccday of the week, as an abbreviate localized stringWed
ccccday of the week, as an unabbreviated localized stringWednesday
cccccday of the week, as a single localized letterW
Lmonth as an unpadded number8
LLmonth as a padded number08
LLLmonth as an abbreviated localized stringAug
LLLLmonth as an unabbreviated localized stringAugust
LLLLLmonth as a single localized letterA
yyear, unpadded2014
yytwo-digit year14
yyyyfour- to six- digit year, pads to 42014
Gabbreviated localized eraAD
GGunabbreviated localized eraAnno Domini
GGGGGone-letter localized eraA
kkISO week year, unpadded14
kkkkISO week year, padded to 42014
WISO week number, unpadded32
WWISO week number, padded to 232
oordinal (day of year), unpadded218
oooordinal (day of year), padded to 3218
qquarter, no padding3
qqquarter, padded to 203
Dlocalized numeric date9/4/2017
DDlocalized date with abbreviated monthAug 6, 2014
DDDlocalized date with full monthAugust 6, 2014
DDDDlocalized date with full month and weekdayWednesday, August 6, 2014
tlocalized time9:07 AM
ttlocalized time with seconds1:07:04 PM
tttlocalized time with seconds and abbreviated offset1:07:04 PM EDT
ttttlocalized time with seconds and full offset1:07:04 PM Eastern Daylight Time
Tlocalized 24-hour time13:07
TTlocalized 24-hour time with seconds13:07:04
TTTlocalized 24-hour time with seconds and abbreviated offset13:07:04 EDT
TTTTlocalized 24-hour time with seconds and full offset13:07:04 Eastern Daylight Time
fshort localized date and time8/6/2014, 1:07 PM
ffless short localized date and timeAug 6, 2014, 1:07 PM
fffverbose localized date and timeAugust 6, 2014, 1:07 PM EDT
ffffextra verbose localized date and timeWednesday, August 6, 2014, 1:07 PM Eastern Daylight Time
Fshort localized date and time with seconds8/6/2014, 1:07:04 PM
FFless short localized date and time with secondsAug 6, 2014, 1:07:04 PM
FFFverbose localized date and time with secondsAugust 6, 2014, 1:07:04 PM EDT
FFFFextra verbose localized date and time with secondsWednesday, August 6, 2014, 1:07:04 PM Eastern Daylight Time
Xunix timestamp in seconds1407287224
xunix timestamp in milliseconds1407287224054