Date & Time to String: Format Guide

Click to copy

Used to set the format of the output string.

Example: Date & Time to String(value: 26th Nov 2021, 16:00:00, format: "YY-MM-DD hht") = "21-11-26 04PM".

Tip: You can combine as many placeholders together and add other characters, such as underscores (_), slashes (/), and similar.

YYYY2021Year in full.
YY21Last 2 digits of the year.
MMMMJanuaryMonth in full.
MMMJanMonth in short format.
MM01Month number with a leading zero.
M1Month number wihout a leading zero.
DD09Day number with a leading zero.
D9Day number without a leading zero.
YD231Day of the year.
hh03Hours in 12-hour format with a leading zero.
h3Hours in 12-hour format without a leading zero.
HH15Hours in 24-hour format.
mm05Minutes with a leading zero.Minutes without a leading zero.
m5Minutes without a leading zero.
ss06Seconds with a leading zero.
s6Seconds without a leading zero.
tAM/PMTime of day.
z+06Timezone in short format.
Z+06:00Timezone in full.
WMondayDay of week in full.
wMonDay of week in short format.
YW44Week number.