web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

Save utcDateTime without timezone conversion

(1) ShareShare
ReportReport
Posted on by 110

Hi all,

I want to save utcDatetime which bounded to a datasource without affected by timezone (the system will automatically convert time to user timezone).

For ex: I insert 7:00 AM 2/3/2020 at GMT +7 to a bounded field, but when I used another user account which has GMT -7 as timezone, the field shows 7:00 PM 2/2/2020. I want to keep 7:00 AM 2/3/2020 to show for user at timezone GMT -7:00

Is there anyway to do it ?

Thanks in advance.

I have the same question (0)
  • Verified answer
    Austin Shen Profile Picture
    on at

    Hi Nguyen,

    If you always want to show UTC date time, you could consider use TimezonePreference property of date time control and set it to no Conversation. Below document would provide more info about this property.

    docs.microsoft.com/.../form-control-properties

    If you always want to show UTC-7 date time, one possible approach may be to use an edit method with getter always get UTC-7 date time based on API DateTimeUtil:: applyTimeZoneOffset.

    Please let us know if it works for you. Thank you.

    Best Regards,

    Austin Shen

  • Nguyen Do Huy Profile Picture
    110 on at

    Hi Austin, 

    I tried applytimezoneoffset, but its not working. because the data saved in table is already converted to user's timezone

  • Austin Shen Profile Picture
    on at

    Hi Nguyen,

    Would you mind sharing more about your code? Generally saying, data stored in the table would be UTC date time. Thank you.

    Best Regards,

    Austin Shen

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    No, date time values are not stored in user's timezone. On the contrary, user's timezone offset is removed from the value and the value stored is intendent on users' timezones (it's stored as UTC).

  • Nguyen Do Huy Profile Picture
    110 on at

    Hi Austin, something like this

    I insert time like this by my account (which timezone is GMT -8)

    pastedimage1583308065314v1.png

    But when I use another account (which timezone is GMT +7)

    pastedimage1583308174260v2.png

    It\s converted to this. but I want to show the time that I inserted in timezone GMT -8

  • Nguyen Do Huy Profile Picture
    110 on at

    Yes Martin, but when I browsed to the table by user has timezone GMT +7, i saw it already converted

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    That the data is presented to every user in his or her timezone doesn't mean that it's stored in a timezone of one of this users. In fact, it wouldn't work. It works as I said - it's stored in UTC and merely displayed according to users' setup.

    If it happens that your values aren't stored in UTC, it seems you have a bug in your code which broke the standard functionality. But your description suggests that everything works as expected and you merely confuse storage with displaying in forms (which are two different things).

  • Nguyen Do Huy Profile Picture
    110 on at

    Thanks Martin,

    Is there anyway to present to users in different timezone without conversion ?

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    I believe this is already covered by the first reply.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 283 Super User 2025 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 213 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 152 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans