Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

    Code Block
    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

    Code Block
    {{msg.payload.message}}

Related Articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "getting-started"