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 :
Microsoft Dynamics CRM (Archived)

Compare Time zone independent and User Local DateTime fields

(0) ShareShare
ReportReport
Posted on by

Hello Guys,

I have two Date Time fields in two entities. One of the DateTime fields is Time Zone Independent and the other is User Local. How do I compare these two fields to check if they're equal?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    prt33k Profile Picture
    6,907 on at

    Hi Donald,

    A timezone independent field doesn't change with timezone while User Local changes with user local setting.

    So when you say to compare the field - for certain user based on timezone the value can be equal or not.

    Are all users in your system using the same timezone?

    Thanks,

    Prateek

  • Community Member Profile Picture
    on at

    Hi Prateek,

    Thanks for the response. No, users do not have the same timezone. What do you suggest I do?

  • prt33k Profile Picture
    6,907 on at

    I cant think of simple way - what are these field used for? Is it okay to ignore the time and consider only the date?

    Ideally you need to delete the timezone independent and create a user local one.

  • Community Member Profile Picture
    on at

    Hi Prateek,

    Unfortunately, it's the other way around. I need the time. I don't care about the date.

  • prt33k Profile Picture
    6,907 on at

    Well.. is this existing data or you can make changes?

    If you can make changes then replace the timezone independent with user locale.

    If not, then other option I can see is to read the Audit log and find which user created the data. find the locale of that user and then change the timezone independent field data to UTC one. After that your compare will work - but this will slow the system drastically. Reading audit should be the last resort.

    The problem is - a user A from India would have stored 5:30 AM while a user B in UK would store 00:00AM. The time is same but the comparison wont work - we have to somehow find the timezone which the user A used to create timezone independent field which is a lost data.

  • Community Member Profile Picture
    on at

    Hi Prateek,

    It's existing data. Ok.. I guess that is a way to try to solve it. I will try that.

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans