Date and time format in the Commerce Engine and Business Tools

Abstract

Understand how the Commerce Engine handles date and time format to be consumed by the Business Tools and the Storefront.

It is important to understand how the Commerce Engine handles time format in timestamps, or when it comes to time sensitive business operations like promotions, for example.

The Commerce Engine uses UTC date and time format both in processes, and when storing date and time in the database. The date and time format is not configurable.

<! -- Schema: {{ value_expression | date [ : format [ : timezone [ : locale ] ] ] }}-->

When the XC Business Tools application renders date and time information via Angular, it uses the raw value and converts it to the business user's local time.

On the storefront, date and time are also converted to the visitor's local time.

Business Tools code sample (in HTML)

<div *ngIf="property.UiType !== 'FullDateTime'">
        {{property.Value | date:'shortDate':'':bizFxContext.language}}

    </div>
  </div>

Response from the Commerce Engine (JSON)

Name":"ValidFrom","Policies":[
      ],"DisplayName":"Valid From","Value":"2020-11-05T08:32:27.8320000+00:00","IsHidden":false,"OriginalType":"System.DateTimeOffset","IsReadOnly":true,"UiType":"","IsRequired":true
    },
]