AdvancedFormat date and time

Format date and time

Choose a date field, output format and timezone for a formatted value.

Use Format Date/Date & Time to turn a stored date into the text format needed by a message or workflow. Keep the source date and save the formatted result in a separate field.

The earlier guide documents the steps below. Confirm the action and timezone controls in your current account before using the result in a customer flow.

Configure the action

  1. Open the intended flow in Flow Builder.
  2. Add an Action and select Format Date/Date & Time.
  3. Select the date custom field containing the source value.
  4. Enter the format string.
  5. Under Save the formatted date to, select or create the field that will hold the result.
  6. Choose the Page or user's timezone, as appropriate for the workflow, then save.

The earlier guide offers Page and user timezone choices. Check which timezone is actually configured and whether a user timezone is available. For Malaysian workflows, confirm the chosen timezone and output with a known date, including a time near midnight. Changing the display format alone does not establish which timezone was applied.

Format example

The source uses this format string:

d-m-Y; h-i a

For 23 January 2022 at 2:00 am in the selected timezone, the PHP-style tokens describe 23-01-2022; 02-00 am. The a token represents am or pm; it does not add periods. Verify the actual Bual Pro output before using a format in a live message.

Format-token reference

These tokens are transcribed from the earlier guide's tables. They follow the PHP-style date formatting reference. Current support for every token in Bual Pro has not been runtime-tested; use the tokens your action accepts.

Day and week

TokenMeaning
dDay of month with a leading zero, 01 to 31.
DThree-letter day name, Mon to Sun.
jDay of month without a leading zero, 1 to 31.
lFull day name, Sunday to Saturday; this is a lowercase letter L.
NISO weekday number, Monday 1 to Sunday 7.
SEnglish ordinal suffix: st, nd, rd or th.
wWeekday number, Sunday 0 to Saturday 6.
zDay of year starting from 0.
WISO week number; weeks start on Monday.

Month and year

TokenMeaning
FFull month name, January to December.
mMonth with a leading zero, 01 to 12.
MThree-letter month name, Jan to Dec.
nMonth without a leading zero, 1 to 12.
tNumber of days in the month.
LLeap-year indicator: 1 for a leap year, otherwise 0.
oISO week-numbering year; this may differ from the calendar year near New Year.
YFour-digit calendar year.
yTwo-digit calendar year.

Time and timestamp

TokenMeaning
aLowercase am or pm.
AUppercase AM or PM.
g12-hour time without a leading zero, 1 to 12.
G24-hour time without a leading zero, 0 to 23.
h12-hour time with a leading zero, 01 to 12.
H24-hour time with a leading zero, 00 to 23.
iMinutes with a leading zero, 00 to 59.
sSeconds with a leading zero, 00 to 59.
USeconds since the Unix epoch, 1 January 1970 at 00:00:00 UTC.

See the PHP date-format reference for token definitions. That reference does not establish which PHP version or tokens Bual Pro implements.

Use the result in a flow

Insert the destination field through the field picker in the message or action that needs the formatted text. Keep calculations on numeric timestamps separate from display formatting. If start and stop values are Unix seconds, elapsed minutes are calculated as (stop - start) / 60; confirm the input units before using this calculation.

Review timestamp conversion, custom fields and math calculations for related steps.