locked
Datetime Field Problem RRS feed

  • Question

  • Hi all,

    I have a Date (Date and Time) field in a CRM Form. When user enter 3/3/2010 2:00pm in CRM, it saved as 3/3/2010 9:00pm in database.

    Anybody get ideas about what happened?

    Thanks in advance.

    Donna.

    Wednesday, March 17, 2010 9:17 PM

Answers

  • paste this in your SQL management studio and see what details you get...


    select

     

    top 1 createdonutc,createdon from FilteredAccount

    select

     

    top 1 createdonutc,createdon from FilteredIncident


    this should clear this up..

    • Marked as answer by 狐狸糊涂 Wednesday, March 17, 2010 10:30 PM
    Wednesday, March 17, 2010 10:15 PM
    Answerer

All replies

  • after saving what's users see when he/she opens the record? if it is 3/3/2010 2:00pm then it would be seems that CRM server time zone and User time zone is different...(user may be UK and server may be US or otherway around)..


    so if user views correct data ..i guess you can ignore it...but if you make same time zone on user/time that it should solve the issue..

    Hope this helps..

    Wednesday, March 17, 2010 9:29 PM
    Answerer
  • Hi Donna,

    DateTime attributes are stored in UTC format. 
    So if, you have an timezone offset of -7 hours, everything is fine.
    Wednesday, March 17, 2010 9:36 PM
  • Thank you for reply...
    when reopen the form, user get the same time 3/3/2010 2:00pm as input.

    the thing is I need to create report by retrieving data from database, which gives me wrong time 3/3/2010 9:00pm. I checked the server time zone setting, it is same as user's. They both are Pacific Time (US & Canada).

    Is there any way to fix it?

    Thank you,
    Donna.
    Wednesday, March 17, 2010 9:39 PM
  • Hi Donna,

    DateTime attributes are stored in UTC format. 
    So if, you have an timezone offset of -7 hours, everything is fine.

    Thanks Ckeller. Could you please explain a little bit more on how to set the offset in CRM?

    Thank you,
    Donna.
    Wednesday, March 17, 2010 9:42 PM
  • when retriving the data for report use the utc field on that table...for e.g. createon is datetime field so if you retrive createdonutc field it should get you the correct data..

    Wednesday, March 17, 2010 9:46 PM
    Answerer
  • when retriving the data for report use the utc field on that table...for e.g. createon is datetime field so if you retrive createdonutc field it should get you the correct data..


    utc field? Sorry, I don't quite understand.
    I only have one CreatedOn field. I do not have that CreatedOnutc field in neither CRM nor database....
    Wednesday, March 17, 2010 10:03 PM
  • paste this in your SQL management studio and see what details you get...


    select

     

    top 1 createdonutc,createdon from FilteredAccount

    select

     

    top 1 createdonutc,createdon from FilteredIncident


    this should clear this up..

    • Marked as answer by 狐狸糊涂 Wednesday, March 17, 2010 10:30 PM
    Wednesday, March 17, 2010 10:15 PM
    Answerer
  • paste this in your SQL management studio and see what details you get...


    select

     

    top 1 createdonutc,createdon from FilteredAccount

    select

     

    top 1 createdonutc,createdon from FilteredIncident


    this should clear this up..


    I get it.
    Thank you, MayankP.

    Donna.
    Wednesday, March 17, 2010 10:30 PM