Skip to main content
By default, Chatbot Builder AI often stores time as Unix timestamps (e.g., 1735665749), which are great for computers but confusing for humans. This guide shows you how to convert these numbers into friendly formats like “Tuesday, December 31st, 2024” or interpret natural language input like “next Friday at 2 PM.”

Common System Fields

Before formatting, identify which time data you are working with:
VariableDescription
{{current_time}}The bot’s current server time (Unix Timestamp).
{{current_user_time}}The user’s local time (if available).
{{last_interaction}}Timestamp of the user’s last message/action.

Formatting Methods

Formatting Reference Sheet

Use these characters to construct your Format Pattern.

Date Components

CodeDescriptionExample
dDay (2 digits)01 to 31
jDay (no leading zero)1 to 31
SOrdinal Suffixst, nd, rd, th
lFull Day NameTuesday
DShort Day NameTue
FFull Month NameDecember
MShort Month NameDec
mMonth (digits)12
YYear (4 digits)2024

Time Components

CodeDescriptionExample
g12-hour format (no zero)1 to 12
h12-hour format (w/ zero)01 to 12
H24-hour format00 to 23
iMinutes00 to 59
aam/pm (lowercase)pm
AAM/PM (uppercase)PM

Practical Examples

1. Friendly Receipt Header

Pattern: l, F jS Output: “Friday, October 24th”

2. Standard Database Format

Pattern: Y-m-d H:i:s Output: “2024-10-24 14:30:00”

3. Chat Message Reminder

Pattern: g:i A on D, M j Output: “2:30 PM on Fri, Oct 24”
Pro Tip: If you need to calculate the difference between two times (e.g., duration of stay), keep the variables as Unix Timestamps, perform the math, and only format the result at the very end.