AMPscript Date and Time Formats - Format() and FormatDate()

Compare date and time formats for the AMPscript functions Format() and FormatDate(). The % column shows the result when you use % to force a single-character token to behave as if it’s in a multi-character string, if applicable.

Date Formats

Example: 10/5/2017 8:09:34 PM

TokenFormat() Result%FormatDate() Result%
d10/5/2017510/5/20175
dd0505
dddThuT8ur345a17
ddddThursdayThu
dddddThursdayThursday
fThursday, October 5, 2017 8:09 PM0Thursday, October 5, 2017 8:09 PM5
ff0056
fff000567
ffff00005678
fffff0000056789
g10/5/2017 8:09 PMA.D.10/5/2017 8:09 PMA.D.
ggA.D.A.D.
MOctober 510October 510
MM1010
MMMOctOct
MMMMOctoberOctober
yOctober 201717October 201717
yy1717
yyy20172017
yyyy20172017
sortable34orPable2017-10-05
isoi34o2017-10-05T20:09:34.5678900-06:00
rThu, 05 Oct 2017 20:09:34 GMTrThu, 05 Oct 2017 20:09:34 GMTr
rfcr0cThu, 05 Oct 2017 20:09:34 GMT
s2017-10-05T20:09:343410/5/201734
S10/5/2017 8:09:34 PMS10/5/2017S
u2017-10-05 20:09:34Zu2017-10-05 20:09:34Zu
UFriday, October 6, 2017 2:09:34 AMUFriday, October 6, 2017 2:09:34 AMU
t8:09 PMP8:09 PMP
T8:09:34 PMT8:09:34 PMT

Time Formats

Example: 10/5/2017 8:09:34 PM

TokenFormat() Result%FormatDate() Result%
h10/5/2017 8:09:34 PM82020
hh0820hh
H10/5/2017 8:09:34 PM202020
HH2020
K10/5/2017 8:09:34 PM-06:00-06:00
mOctober 5999
mm0909
s2017-10-05T20:09:34348:09 PM34
ss3434
t8:09 PMPPP
ttPMPM
z10/5/2017 8:09:34 PM-6-6-6
zz-06-06
zzz-06:00-06:00
sortable34orPableT20:09:34
short348orP8:09 PM
s2017-10-05T20:09:34348:09 PM34
S10/5/2017 8:09:34 PMS8:09 PM34
longlonA.D.8:09:34 PM
l10/5/2017 8:09:34 PMl8:09:34 PMl