How do I use time zone?

In Orbita, Time Zone lets the Voice assistant identify when to invoke tasks/actions. Time zone is used in Calendar events, tasks, etc.

When an admin creates a user account, the system will assign the time zone as “US/EASTERN” by default.

The system converts the time to UTC (Universal Time Coordinated) and stores it. This time will be adjusted according to the user’s time zone and will be displayed to the user.

How to change the time zone as a user?

Users can change their time zone.

  1. Login to Experience manager.

  2. Click the down arrow next to the User’s name.

  3. Select Settings from the drop-down.

  4. In the Info tab, scroll down to Time Zone and change it.

  5. Click Save.

How is the time zone used in the Experience Designer?

Consider the example flow where the user will get a greeting message based on their time zone.

  • User manager node. Used to get the user profile information.

  • Function node.

    You can write a custom code based on your business requirements. In this example, the following code gets the user’s time zone and greets the user based on the time of the day.

    Example code

    var tz = global.get("momentTimezone"); var moment = global.get("moment"); var userTimezone = msg.data.userData.users[0].personaProfile.timezone; var adjustedTime = tz.tz(moment(), userTimezone).format("H"); var message; if (adjustedTime < 12 ) {     message = "Good Morning"; } else if(adjustedTime < 15) {     message = "Good Afternoon" } else {     message = "Good Evening" } msg.payload.message = message; return msg;
  • Say node.

    A say node contains a message that is read out or shown, by the voice assistant or smart display.

    Example code

    {{msg.payload.message}}

Related Articles