Skip to main content

Notifications

Customer Service forum
Suggested answer

Changing Date and Time Field behaviour from User Local to Date Only

Posted on by 335

Hi There,

Looking to confirm if changing the Behaviour of a Date and Time Field from User Local to Date Only will change any current records.

this is Dynamics online.. Field setting is behaviour = user local, format = date only.

My understanding is that the current values will remain in database as UTC time and the change only effects records created or updated from the point of the Field change.

thanks in advance

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Changing Date and Time Field behaviour from User Local to Date Only

    Hi partner,

    Maybe I didn't make myself clear. Yes, whatever the behaviour you choose,  nothing will happen in the database.

    I created a new datetime field and to make the results more clearly, I chose the format to 'date and time', then I changed the format from User Local to Date Only and here are the results in database and client.

    1.User Local

    Client: 2020-02-11 12:00 AM

    Database: 2020-02-10 16:00:00.000

    pastedimage1581392570572v2.png

    pastedimage1581392473084v1.png

    2.Date Only

    Client: 2020-02-10

    Database: 2020-02-10 16:00:00.000

    pastedimage1581392635093v3.png

    pastedimage1581392677706v4.png

    From the above picture, we could know that whatever the behaviour or format we choose in datetime field, the value will never change in database, it's always UTC time.

    Best Regards,

    Leo

  • smcconnell Profile Picture
    smcconnell 335 on at
    RE: Changing Date and Time Field behaviour from User Local to Date Only

    Hi Leo,

    Thanks again.

    the query was related to changing the behaviour from User Local to Date Only and what if anything happens to the value in the database.

    thanks

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Changing Date and Time Field behaviour from User Local to Date Only

    Hi smcconnell,

    Thanks for your details.

    Still correct, even if we changed the datetime to user local, there would be no change in database level.

    Since we could not access to database directly in online version, I did a test in my on-premise instance.

    There's an OOB field "createdon" which is user local in account form and we can see that the value is different between client and database.

    pastedimage1581341025543v1.png

    And if we work with datetime in plug-ins or sdks, the datetime value we get is the value in database not in client.

    Hope it helps.

    Best Regards,

    Leo

  • smcconnell Profile Picture
    smcconnell 335 on at
    RE: Changing Date and Time Field behaviour from User Local to Date Only

    Hi Leo,

    thanks for the reply.

    I've read the documentation so i'm aware of the potential changes on the front end based on a users personal settings.

    my query is more on what happens to the current records at the database level.  so if i was to access those records through a plugin/sdk i'm assuming there would be no change seen there?

    thanks

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Changing Date and Time Field behaviour from User Local to Date Only

    Hi partner,

    You are correct.

    The value is stored in common date base as UTC time and it will show as local time in the field according to the user's language/locale. When we change the field format, all values in this field will display in a new format.

    pastedimage1581338730734v1.png

    https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/behavior-format-date-time-field

    Best Regards,

    Leo

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

News and Announcements

Give Back to the Community this Month

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,807 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,135 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans