<-- Back

UTC time is displayed differently in native apps

Issue

When the Date and Time attribute is viewed in the native app, it fails to adhere to the non-localized setting. Rather than displaying the UTC time, it adjusts to the user's device time zone.

Environment

  • Mobile
  • Native app

Cause

Utilizing the time element of a non-localized Date and Time attribute generally leads to complications. It is important to recognize that only the date component should be utilized, not the time component. Studio Pro provides a warning about this during the attribute's creation. To guarantee the accuracy of the displayed date, a conversion occurs between the server and the client, rendering the UTC or any other time zone designation irrelevant. Consequently, trying to use the time element can produce unforeseen outcomes. Hence, Studio Pro advises that non-localized Date and Time attributes are intended solely for dates, not times, and this is by design.

Solution/Workaround

One approach is to compute the desired time display within a microflow or nanoflow, save it as a string variable, and then present it on the page.

Internal information related

  • 145549 and 227896

Additional information 

Date Picker | Mendix Documentation

Have more questions? Submit a request

0 Comments

Article is closed for comments.

To provide feedback, please open a ticket here. Don't forget to include the article's URL along with the feedback you would like to provide.