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)

Change "DateTime" format into "Date Only" from existing record.

(0) ShareShare
ReportReport
Posted on by

I have a "DateTime" field and declared the format as Date and Time. But it saves the date as UTC format. when I fetch data in the plugin then it shows the one day back DateTime (UK DateTime).

3554.datetime.png

After few months I changed it to "Date Only" format. Now it picks the local DateTime.

Problem is how to convert DateTime from all record which was created at that time.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Pawan,

    What I understand that you need the date only value instead of date time value. As you are on premise so I would suggest go to the data base and find the entity with the date only field.

    You can see the date time column of the field , the difference "datetime and date only " value you will find the time part for date only value is : "12:00 AM" which means those value has been inserted when you made it date only and others value may have full time.

    Now for datetime value  , you can easily convert with local datetime and you know those value are basically UTC format, convert those value to local datetime and update.

    There is  built in SQL function by which you can convert to UTC datetime to local date  using offset.

    Please follow below reference hope you will get help from here.

    community.dynamics.com/.../dynamics-crm-datetimes-the-last-word

    Please note before doing any update, first try to do some data analysis and try to retrieve the data with changing local date format and check whether those data are as expected as you want and then you execute your final query.

  • Community Member Profile Picture
    on at

    Hi Goutam ,

    I am using MSCRM online.  I try to fix using following link.

    www.inogic.com/.../updating-date-values-of-existing-records-after-modifying-the-datetime-behaviour-in-dynamics-crm-online-update-1

    but I do not understand where to write the code.

  • Suggested answer
    Temmy Wahyu Raharjo Profile Picture
    2,916 on at

    Hi, You can create Console Application using this tutorial:

    msdn.microsoft.com/.../jj602970.aspx

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Pawan,

    If you are online then create a console application retrieve the date field value using fetchXML or web API  and convert it to your local datetime using C# and then update the record again .

    Here is sample console application.

    community.dynamics.com/.../273478

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