locked
Input Date in Custom Workflow Activity RRS feed

  • Question

  • Hi Experts

    In CRM 2015, I am passing date with a value of 02/10/2015 (dd/Mm/yyyy) but it becomes 01/10/2015 23:00:00.

    Does anybody know why is such a behaviour and what is the fix?

    Thanks in advance.

    Thursday, February 11, 2016 8:09 AM

Answers

  • If time is in BST, you see one hour less e.g. 01/10/2015 will be stored in DB as 30/09/2015 23:00:00. You have to convert your dates to ToLocalTime before you use it in fetch xml.

    • Marked as answer by Gatotkacha Wednesday, February 24, 2016 10:11 AM
    Wednesday, February 24, 2016 10:11 AM

All replies

  • Hi,

    Check your System Date format settings?

    System Settings ->Format

    Regards,


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari http://microxrm.blogspot.in

    Thursday, February 11, 2016 8:39 AM
  • CRM will apply the users timezone settings whenever datetime fields are used (saving data, or reading data). There are 2 possible reasons for your issue:

    • Either the users reading and writing the data have different timezones
    • Or, if you are updating the datetime field through code (e.g. a custom workflow activity), then you will need to apply the appropriate timezone so that the behaviour is the same as in CRM 

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Thursday, February 11, 2016 10:15 AM
    Moderator
  • Thanks Yusuf for your reply but setting didn't help.
    • Edited by Gatotkacha Thursday, February 11, 2016 11:12 AM
    Thursday, February 11, 2016 11:05 AM
  • Thanks David for your reply. Where are these two settings for read/write dates?

    On this specific occassion, I am just passing a date to custom WFA and reading it there which is out by a day than what I pass.

    • Edited by Gatotkacha Thursday, February 11, 2016 11:17 AM
    Thursday, February 11, 2016 11:13 AM
  •  These are user personal settings

    1. Log in to CRM

    2. At top left corner of User logo Icon there is setting icon

    3.Click and open the Options.

    4. https://<CRM ORG>/tools/personalsettings/dialogs/personalsettings.aspx

    Regards,


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari http://microxrm.blogspot.in

    Thursday, February 11, 2016 1:06 PM
  • My personal options are correct.

    Thursday, February 11, 2016 1:45 PM
  • I don't understand how it could happen but what I found was it was appending 23:00 time with Date. My Date is Date Only field and hence I was expecting 00:00 time. Other date only fields on the same entity behave as expected but this particualr field had 23:00 time appended. Any idea why is this behaviour?
    Thursday, February 11, 2016 3:07 PM
  • If time is in BST, you see one hour less e.g. 01/10/2015 will be stored in DB as 30/09/2015 23:00:00. You have to convert your dates to ToLocalTime before you use it in fetch xml.

    • Marked as answer by Gatotkacha Wednesday, February 24, 2016 10:11 AM
    Wednesday, February 24, 2016 10:11 AM