locked
Date error on custom fields RRS feed

  • Question

  • Hello, 
    I have a question for you. 
    I found a problem on the dates in the version 2013. 
    There is an offset of 1 hour and 1 day. Example: 6/26/2014 0:00:00 am becomes 6/25/2014 11:00:00 p.m. 
    This happens on the Custom fields. 

    Thank you for guiding me
    Thursday, June 26, 2014 11:06 AM

Answers

  • Right, you should have made that clear from the beginning!

    CRM always stores date internally in UTC format regardless of the users time zone. When a record is displayed in a form, CRM applies the users Time Zone setting to the stored time to display the date and time according to the user's setting.

    If you query the filtered views, CRM has two fields for date fields, the date as per the user's time zone and the date in UTC. The base table (which should not be used for queries) only stores the date in UTC.

    I think this explains your discrepancies.

    • Marked as answer by AATSE Thursday, June 26, 2014 3:02 PM
    Thursday, June 26, 2014 2:10 PM
    Moderator

All replies

  • Probably you are retrieving the date from an external Application (using C# for example) or inside a report.

    inside an external application you need to convert the datetime object to local date time, if you are inside a report make sure you are using the filtered views


    My blog: www.crmanswers.net - Rockstar 365 Profile

    Thursday, June 26, 2014 11:14 AM
  • Think you Guido Peite,

    I forget to say that occured on CRM Form when i save records.

    I don't use external application.

    Regards

    Thursday, June 26, 2014 11:24 AM
  • So you are saying that you select a date inside CRM form, like 6/26/2014 3pm and after you save you get the value less 1h?

    there are JavaScript customization or a plugin on this form/entity?


    My blog: www.crmanswers.net - Rockstar 365 Profile

    Thursday, June 26, 2014 11:33 AM
  • There are JavaScript customization but they don't modify Date field value.

    It can be a probem?

    Regards

    Thursday, June 26, 2014 11:53 AM
  • something is happening, because the behavior you described is not normal. but without more details about your customization is not possible to identify the cause

    My blog: www.crmanswers.net - Rockstar 365 Profile


    Thursday, June 26, 2014 11:58 AM
  • Could this be a time zone issue? Perhaps one user entered the date and then another user (set to a different time zone) is viewing the record?

    Thursday, June 26, 2014 12:07 PM
    Moderator
  • OK,

    I create a new entity and there are not JavaScript customization or a plugin on this form/entity

    But there are the same problem.

    Regards

    Thursday, June 26, 2014 12:20 PM
  • I thought about that. But I made myself the tests. And it happens again.
    I thought that the server does not have the same time zone as me, but it is the same.
    I sure anymore what to think!
    Thursday, June 26, 2014 1:14 PM
  • From your first post I think the offset is 1 hour and not 1 day and 1 hour. This sounds suspiciously like the 1 hour from daylight savings.

    What happens if you enter a date with a time of, say, 4.00pm. Does the time become 3.00pm after the save?

    Thursday, June 26, 2014 1:20 PM
    Moderator
  • Sorry the offset is 1 hour.

    When i enter a date with a time is 4.00 pm, the time become 3.00pm after the save.

    Regards

    Thursday, June 26, 2014 1:26 PM
  • Well this is very strange. You say that there are no JavaScript or plug-ins running. The only other things I can think of are Workflow but that wouldn't show up immediately unless it was a real-time workflow and you tried it on a new entity and similarly for business rules.

    Things to try:

    1. Does this happen to other users?
    2. What happens if you change your time zone setting to a different value and then try?
    Thursday, June 26, 2014 1:32 PM
    Moderator
  • Things to try:

    1. Does this happen to other users?
    2. What happens if you change your time zone setting to a different value and then try?

    1- Yes

    2- When i change my time (from UTC to UTC+1), i have the same result.

    NB: When I looked the record i saw this value:

    TimeZoneRuleVersionNumber: 12

    UTCConversionTimeZoneCode: 84

    It can be a problem?

    Thursday, June 26, 2014 1:48 PM
  • Just specify that on the form the data is displayed correctly. The problem is in the database 

    Regards

    Thursday, June 26, 2014 1:51 PM
  • Do you mean that the date and time is shown on the form correctly and does not change from what was entered and it is only in the database that the difference appears?

    Thursday, June 26, 2014 1:56 PM
    Moderator
  • Yes.

    Regards

    Thursday, June 26, 2014 2:03 PM
  • Right, you should have made that clear from the beginning!

    CRM always stores date internally in UTC format regardless of the users time zone. When a record is displayed in a form, CRM applies the users Time Zone setting to the stored time to display the date and time according to the user's setting.

    If you query the filtered views, CRM has two fields for date fields, the date as per the user's time zone and the date in UTC. The base table (which should not be used for queries) only stores the date in UTC.

    I think this explains your discrepancies.

    • Marked as answer by AATSE Thursday, June 26, 2014 3:02 PM
    Thursday, June 26, 2014 2:10 PM
    Moderator
  • OK,

    Thx for your Answer.

    I saw the difference now and it is very important to know that.

    I'm in the UTC zone but the date is not same.

    I think it is something else that is not related to CRM.

    Regards,

    Thursday, June 26, 2014 3:06 PM