Some of our customers have asked for a way to display the current time/date/day of the week in a node, set the time zone, and custom format it. There’s a predefined Zingtree Webhook to do just that!
This webhook sets a variable named #timestamp# which you can use in any part of your decision tree, format it in a variety of ways, and even perform logic operations on it. Click through below to see our demo of how it all works…
- Display the day of the week.
- Use a Logic Node to route customers to different nodes for work hours, after hours or weekends.
- Show the current date and time, display it in a node, and save it as a part of your session.
How to Set Up Timestamps
- Edit a node, and open the Show Advanced Options link.
- Under “Send Message to App”, select Webhook: Zingtree Timestamp.
- You can also include an optional timezone or a date format as parameters to sent to the webhook. (More details below). It looks like this:
- In the content area for your node, the timestamp will appear wherever you enter #timestamp#.
- Click Save Changes when you are done.
In the Message area, you can include two parameters:
- &tz= to set a time zone.
- &format= to set a custom date format.
Example message area customizations:
&tz=America/New_York&format=F j,Y h:i:s A
This sets the time zone to Eastern Time (USA), and makes the timestamp variable look like ” “.
This sets the timezone to Sydney, Australia, and makes the date appear as “25/07/2017”.
This sets the #timestamp# variable to the day of the week.
The full list of timezones is here.
The full list of date formatting options is here.