AMPscript の日時形式 - Format() および FormatDate()
AMPscript 関数の Format() と FormatDate() で日時形式を比較します。% 列は、% を使用して、複数文字の文字列内にあるかのように 1 文字トークンの動作を強制した場合の結果を示しています (該当する場合)。
例: 10/19/2017 8:09:34 PM
トークン | Format() の結果 | % | FormatDate() の結果 | % |
---|---|---|---|---|
d | 10/19/2017 | 19 | 10/19/2017 | 19 |
dd | 19 | 19 | ||
ddd | Thu | T8ur345a17 | ||
dddd | Thursday | Thu | ||
ddddd | Thursday | Thursday | ||
f | Thursday, October 19, 2017 8:09 PM | 0 | Thursday, October 19, 2017 8:09 PM | 19 |
ff | 00 | 56 | ||
fff | 000 | 567 | ||
ffff | 0000 | 5678 | ||
fffff | 00000 | 56789 | ||
g | 10/19/2017 8:09 PM | A.D. | 10/19/2017 8:09 PM | A.D. |
gg | A.D. | A.D. | ||
M | October 19 | 10 | October19 | 10 |
MM | 10 | 10 | ||
MMM | Oct | Oct | ||
MMMM | October | October | ||
y | October 2017 | 17 | October 2017 | 17 |
yy | 17 | 17 | ||
yyy | 2017 | 2017 | ||
yyyy | 2017 | 2017 | ||
sortable | 34orPable | 2017-10-19 | ||
iso | i34o | 2017-10-19T20:09:34.5678900-06:00 | ||
r | Thu, 19 Oct 2017 20:09:34 GMT | r | Thu, 19 Oct 2017 20:09:34 GMT | r |
rfc | r0c | Thu, 19 Oct 2017 20:09:34 GMT | ||
s | 2017-10-19T20:09:34 | 34 | 10/19/2017 | 34 |
S | 10/19/2017 8:09:34 PM | S | 10/19/2017 | S |
u | 2017-10-19 20:09:34Z | u | 2017-10-19 20:09:34Z | u |
U | Friday, October 6, 2017 2:09:34 AM | U | Friday, October 6, 2017 2:09:34 AM | U |
t | 8:09 PM | P | 8:09 PM | P |
T | 8:09:34 PM | T | 8:09:34 PM | T |
例: 10/19/2017 8:09:34 PM
トークン | Format() の結果 | % | FormatDate() の結果 | % |
---|---|---|---|---|
h | 10/19/2017 8:09:34 PM | 8 | 20 | 20 |
hh | 08 | 20 | hh | |
H | 10/19/2017 8:09:34 PM | 20 | 20 | 20 |
HH | 20 | 20 | ||
K | 10/19/2017 8:09:34 PM | -06:00 | -06:00 | |
m | October 19 | 9 | 9 | 9 |
mm | 09 | 09 | ||
s | 2017-10-19T20:09:34 | 34 | 8:09 PM | 34 |
ss | 34 | 34 | ||
t | 8:09 PM | P | P | P |
tt | PM | PM | ||
z | 10/19/2017 8:09:34 PM | -6 | -6 | -6 |
zz | -06 | -06 | ||
zzz | -06:00 | -06:00 | ||
sortable | 34orPable | T20:09:34 | ||
short | 348orP | 8:09 PM | ||
s | 2017-10-19T20:09:34 | 34 | 8:09 PM | 34 |
S | 10/19/2017 8:09:34 PM | S | 8:09 PM | 34 |
long | lonA.D. | 8:09:34 PM | ||
l | 10/19/2017 8:09:34 PM | l | 8:09:34 PM | l |