How can I format date & time?
the date & time format is not the same in every place. On Chumchat platform, you can change the format of the date & time by your need.
Follow the steps below to know how to format date and time for your convenient:
Step 1: Go to the flow that you want edit.
Step 2: Among many options on the builder choose “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 “Save the formatted date to” field.
In addition, you can choose the time zone of this formatted date & time for page (or) user’s time zone.
Here is the demo link flow: Click Here
Table explaining the parameters of the date & time formats:
Character Description Values
Day — —
d Day of the month, 2 digits with leading zeros 01 to 31
D A textual representation of a day, three letters Mon through Sun
j Day of the month without leading zeros 1 to 31
l (lowercase ‘L’) A full textual representation of the day of the week Sunday through Saturday N ISO-8601 numeric representation of the day of the week (added in PHP 5.1.0) 1 (for Monday) through 7 (for Sunday)
S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j
w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
z The day of the year (starting from 0) 0 through 365
Week — __
W ISO-8601 week number of year, weeks starting on Monday Example: 42 (the 42nd week in the year)
Month — __
F A full textual representation of a month, such as January or March January through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric representation of a month, without leading zeros 1 through 12
t Number of days in the given month 28 through 31
Year — __
L Whether it’s a leap year 1 if it is a leap year, 0 otherwise.
o ISO-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
Y A full numeric representation of a year, 4 digits Examples: 1999 or 2003
y A two-digit representation of a year Examples: 99 or 03
Time — —
a Lowercase Ante meridiem and Post meridiem am or pm
A Uppercase Ante meridiem and Post meridiem AM or PM
g 12-hour format of an hour without leading zeros 1 through 12
G 24-hour format of an hour without leading zeros 0 through 23
h 12-hour format of an hour with leading zeros 01 through 12
H 24-hour format of an hour with leading zeros 00 through 23
i Minutes with leading zeros 00 to 59
s Seconds with leading zeros 00 through 59
U Seconds 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.
Is this article helpful?
Articles in this section:
- How to get started?
- How to Provide your Own Translations on Built-in Flows?
- Core components of your bot
- How can I change the Default reply?
- How can I change the Welcome message?
- Custom Field
- Tags
- Overview
- How Can I Enable/Disable Message Composer Automatically?
- How to Enable/Disable Message Composer on the flow?
- How can I format date & time?
- How to use External Requests / Dynamic Contents?
- How to send random messages to the users?
- How can I Enable Notify Admins Feature?
- How to send an image/video/file to the users?
- How to create a collection of flow?
- Mailerlite
- PayPal
- General Settings
- Persistent Menu
- Icebreaker
- Greeting Message
- Bot Profile
- Default Reply
- Welcome Message
- GetResponse
- Integromat
- Klaviyo
- Pipedrive
- Platformly
- Zapier
- Truemail
- MooSend
- ActiveCampaign
- MailChimp
- Facebook Ads Integration
- Google Sheets Integration
- Stripe
- How to see all receive messages without a response?
- Get my Chatbot Link
- Analytics – Sales
- New Users Analytics
- How to import subscribers from other bot Platforms?
- How can I export PSIDs?
- How can I enable/disable live chat?
- How I can manually tag a user?
- How to see user information?
- Checkout Settings
- Shipping Settings
- Payment Settings
- Category
- Overview (Ecommerce)
- Delivery Cost based on Location
- Can I change the Symbol of money ($) on my product?
- How to disable the order updates notification?
- How to change the currency of my product?
- How to limit the minimum order value?
- How to set open hours for orders?
- How to enable Pickup on the store option?
- How to change payment methods?
- Add/Edit a Product
- Enable Cash on Delivery
- How to send a broadcast message?
- How to send messages on my user’s own timezone?
- Bot links and Ref Referral Parameters (m.me)
- QR Code Generator
- Facebook Comments
- Cancel Pro Subscription
- What is the OTN (One Time Notification)
- How to do math calculations inside your bot?
- Create Templates
- Triggers and Actions
- GDPR Compliance
- How to get the JSON code for Facebook Ads?
- Set up a Poll with Messenger Chatbot
- What is the maximum file/video size?
- Copy Flow to Another Page
- Where I can find templates?
- How to share a product on another medium?