Format Date and Time

Modified on Sat, 20 Jan at 12:11 PM

Formatting date and time will be useful for anyone who has customers in multiple nations and regions. Because the date & time format is not the same in every place. You can change the format of the date & time to your needs.



Follow the steps below to learn how to format the date and time for your convenience:


Step 1: Go to the flow that you want to edit. Get the date (this is one way of getting date and time to be formatted)





Step 2: Among many options on the builder choose the “Action” option and select “Format Date/Date & Time” on the list.




Step 3: Now select the option on the builder to,


Select the date custom field that contains the date you want to format.


On the next field enter the format of the date and time you need to change from the default (For example, if you want to display the date and time as “23-01-2022; 02-00 a.m” then you need to enter the format field (without quotation) as “d-m-Y; h-i a”. Refer the table below to know more about the parameters).

Then, create a new custom field or select the existing one to store the changed date & time format on the “Save the formatted date to” field.


In addition, you can choose the time zone of this formatted date & time for the page (or) the user’s time zone.




You can download a flow template that uses the same format and features here.


Table explaining the parameters of the date & time formats:


CharacterDescriptionValues
Day
dDay of the month, 2 digits with leading zeros01 to 31
DA textual representation of a day, three lettersMon through Sun
jDay of the month without leading zeros1 to 31
l (lowercase ‘L’)A full textual representation of the day of the weekSunday through Saturday
NISO-8601 numeric representation of the day of the week (added in PHP 5.1.0)1 (for Monday) through 7 (for Sunday)
SEnglish ordinal suffix for the day of the month, 2 charactersst, nd, rd or th. Works well with j
wNumeric representation of the day of the week0 (for Sunday) through 6 (for Saturday)
zThe day of the year (starting from 0)0 through 365
Week
WISO-8601 week number of year, weeks starting on MondayExample: 42 (the 42nd week in the year)
Month
FA full textual representation of a month, such as January or MarchJanuary through December
mNumeric representation of a month, with leading zeros01 through 12
MA short textual representation of a month, three lettersJan through Dec
nNumeric representation of a month, without leading zeros1 through 12
tNumber of days in the given month28 through 31
Year
LWhether it’s a leap year1 if it is a leap year, 0 otherwise.
oISO-8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0)Examples: 1999 or 2003
YA full numeric representation of a year, 4 digitsExamples: 1999 or 2003
yA two-digit representation of a yearExamples: 99 or 03
Time
aLowercase Ante meridiem and Post meridiemam or pm
AUppercase Ante meridiem and Post meridiemAM or PM
g12-hour format of an hour without leading zeros1 through 12
G24-hour format of an hour without leading zeros0 through 23
h12-hour format of an hour with leading zeros01 through 12
H24-hour format of an hour with leading zeros00 through 23
iMinutes with leading zeros00 to 59
sSeconds with leading zeros00 through 59
USeconds since the Unix Epoch (January 1 1970 00:00:00 GMT). This format is very important because it allows you to get the date as total of seconds. With seconds you can do a lot of maths. For example a quiz bot would save the start date a user starts the quiz and also save the date the user finishes the quiz. The bot would calculate the total minutes the user takes to finish the quiz with ({{stop}} – {{start}})/60.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article