web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Community Member Profile Picture
    on at
    RE: Compare Time zone independent and User Local DateTime fields

    Hi Prateek,

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

  • prt33k Profile Picture
    6,907 on at
    RE: Compare Time zone independent and User Local DateTime fields

    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
    RE: Compare Time zone independent and User Local DateTime fields

    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
    RE: Compare Time zone independent and User Local DateTime fields

    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
    RE: Compare Time zone independent and User Local DateTime fields

    Hi Prateek,

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

  • Suggested answer
    prt33k Profile Picture
    6,907 on at
    RE: Compare Time zone independent and User Local DateTime fields

    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

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans