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)

CRM 2013 fixed date time

(0) ShareShare
ReportReport
Posted on by

I want to add date time, which is fixed and does not change as per the users time zone settings, If it is only date field, I am able to keep the date fixed, but right now I need solution for fixed date and time field? 

*This post is locked for comments

I have the same question (0)
  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Nilesh,

    Datetime field in CRM field is always using TimeZone feature and always be saved in Database as UTC.

    www.powerobjects.com/.../crm-2011-truths-about-datetime

    Suggestion I think you can save it to the Text field and then using javascript to display the datetime retrieve from your Text field every time you need this. This is as the text field static fixed data tiem, every time you need either in plugin, javascript, or report (SSRS) you need to retrieve from this.

    Create two field, the Datetime and the Text, So that every time users chose the datetime is from Datatime then you store with code to a text field.

    The problem will come if only you want to show it in the data like chart that you cannot split to the Year, Month, Week.

    Hope this helps.

    Thanks.

  • Community Member Profile Picture
    on at

    Yes, you are right about using the text field. But, suppose if user entered some date time and we saved it to a text field. Now, when the user opens the same form, I need to show the same date time in the date time field? Do you have any solution on this, because in my case user can also update the date time entered.

  • Aileen Gusni Profile Picture
    44,524 on at

    Nilesh,

    Yes, so that once the user open the form you need to auto populate the date time with the string using javascript. Hide the datetime in the view so that users wont confuse.

    Once the user update again the datetime, you store again override the text string and so on.

    Thanks.

  • Verified answer
    NatrajY Profile Picture
    3,040 on at

    Please refer this post from Scott Durow, which gives lot of potential solutions.

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

    Quick summary is that, if you need the date fixed, and dont care about the time component, you will need to manipulate it, so that date remains the same regardless of the user's time zone. This may or may not workout for you, depending on the timezone spread of your users.

    Storing day, month and year is the simple and straight forward way to ensure it remains fixed.

  • Suggested answer
    purwar purwar Profile Picture
    2,836 on at

    You need to capture fixed date time in setpate text field with help of JS or plugin are per requiement. But there will be one problem if user is using NY time zone , Js will polulate according to NY  Time zone . If user using  other time zone js will be capture according to that. due to this again you have two different time zone.

    In this case you can user local time concept. To get the Current logged in user’s Local time You need to first retrieve the Time Zone code of that user using RetrieveCurrentUsersSettings request and then you need to convert the UTC date into user’s Local DateTime.

    You can also convert the Date from Local Datetime format  to the UTC Datetime Format.

    inogic.com/.../how-to-convert-the-datetime-in-local-and-utc-date-time-format

  • Community Member Profile Picture
    on at

    Aileen,

    Yes but each time when we will auto populate the date time from the text box, I think we will need to use "datetimeField.setValue(textBoxValue)", and each time CRM will try to update the record, don't you think so? or do you have any better solution?

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at

    Nilesh,

    I think the same way, but the only way you can have a datetime field with regardless the timezone in CRM is to manipulate like what Raj suggested and to create separate field, either you use text field (one) or plus other fields like separated in 6 fields, Year, Month, Day, Hour, Minute, Second.

    And to show to the user for the second time (after user create the first time), you can show the control using web resource, retrieve from the separated fields, the separated fields I the only way to store the data regardless the datetime timezone.

    Thank you.

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