Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

time conversion from utc to local time(Ist)

(0) ShareShare
ReportReport
Posted on by 5,170

i need add time conversion from utc to local time(Ist)

*This post is locked for comments

  • Verified answer
    Yadnyesh Kuvalekar Profile Picture
    4,102 on at
    RE: time conversion from utc to local time(Ist)

    Also, to let you know, while storing the date time field value using JavaScript, no conversion is needed. CRM stores all date time values in UTC and when we show on the form, CRM automatically converts the field value to user's timezone based on the user's personal setting. The only problem developers face is when we try to retrieve the datetime field value using code. So in that case, you should first fetch the timezone set for logged user and then convert the datetime field value.

  • Verified answer
    Yadnyesh Kuvalekar Profile Picture
    4,102 on at
    RE: time conversion from utc to local time(Ist)

    Hi Sandeep,

    Can you please tell me the exact scenario you are trying, so that I can check if I can help you. Also, can you please let me know the CRM version you are using?

    Also, do you need time part in the date you are using or your business logic is based on Date only? If you are using CRM 2016 environment, then please look into below link. It might help you.

    technet.microsoft.com/.../dn946904.aspx

    Thanks & Regards,

    Yadnyesh Kuvalekar

    Tick verify answer if this resolves your query.

  • Verified answer
    PS Profile Picture
    23,577 on at
    RE: time conversion from utc to local time(Ist)

    @Yadnyesh Kuvalekar can you provide some help

  • sandeepc Profile Picture
    5,170 on at
    RE: time conversion from utc to local time(Ist)

    the answers i am getting from experts like you and others are more better than microsoft as when i raise a ticket most of the time they say coding part we can't help you customization we can help you..

  • Verified answer
    PS Profile Picture
    23,577 on at
    RE: time conversion from utc to local time(Ist)

    if its still not happening, raise a ticket to microsoft and they might help you.

  • sandeepc Profile Picture
    5,170 on at
    RE: time conversion from utc to local time(Ist)

    gmt.PNG time zone is in GMT us and canada.. and it should be not changed as many users have same time zone selected. due date should be in IST and i still did not get solution for this

  • Verified answer
    PS Profile Picture
    23,577 on at
    RE: time conversion from utc to local time(Ist)

    Hi Sandeep

    Go to Options (Wheel Icon) on top right corner>>General Tab>>Set your timezone to CST or GMt-5...this is calle dpersonal option settings

    Timezone settings must be same for all users, if there is just one geographic location.

    Go to settings>.Administrations>>System Settings>>General Tab>>choose timezone

    All users must have same time zone in their personal options as they have in system settings

  • sandeepc Profile Picture
    5,170 on at
    RE: time conversion from utc to local time(Ist)

    var  dueDate = Xrm.Page.data.entity.attributes.get("createdon");

            var now = new Date();

             var endDate = new Date().setDate(now.getDate()+30);

     alert("one");

      utc = now.getTime + (now.getTimezoneOffset() * 60000);

     alert(utc);

       var d = new Date(utc + (3600000*offset));

    var a = d.toLocaleString();

                   alert(a);

    i sthis correct code? or any changes need to be done

    ?

  • sandeepc Profile Picture
    5,170 on at
    RE: time conversion from utc to local time(Ist)

    here time is not related to due date i think , its just showing the present time after 20 mins if i refresh page again it showing that time.. if its 5:30 now if i refresh page on 6pm its showing 6pm time.only date is populating time is not at all behaving

  • sandeepc Profile Picture
    5,170 on at
    RE: time conversion from utc to local time(Ist)

    due date is date and field    i think there is 10:30 hrs difference so y the time not updating and only date is updating.. i am adding many codes still not updating,

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,043 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,864 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans