locked
How to convert Server time to local UTC RRS feed

  • Question

  • Hi ,

     I am getting 9hours variation and it is taking some cannada time and I want to convert it into local time  . This is my temporary solution  when I selected timezone format(i.e in options) as india it  is working fine but when I changed my timezone to some other country it is giving me variation. can u plz help out the permanent solution in mscrm.

    function dateTime() {
       
        var createdon = Xrm.Page.getAttribute("createdon").getValue();
        var formType = Xrm.Page.ui.getFormType();
        var date = new Date();

          if (formType != 1) {
            if (createdon != null) {
                createdon.setHours(createdon.getHours() + 2);       
                if (date > createdon) {
                    Xrm.Page.ui.controls.get("fmc_followupby").setDisabled(true);
                }
            }
        }
    }


    • Edited by hiteksha Saturday, March 1, 2014 2:54 PM
    Saturday, March 1, 2014 2:53 PM

All replies

  • In client-side code, all date should be in the timezone of the current user, based on their settings.

    Can you explain in more detail what you are trying to achieve, and what the problem is ?


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

    Sunday, March 2, 2014 7:46 PM
    Moderator
  • hi,

    if you know the correct time difference , easiest way to use

    .AddMinutes(difference)


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Monday, March 3, 2014 4:01 AM
  • this is a interesting question. you can change end-users' timezone to resolve it.  click top-right corner gear icon, then modify users' timezone.
    Monday, March 3, 2014 8:58 AM