title: Set correct TimeZone in JavaScript and Dynamics CRM
body: <p>I'm really confused in timezones.</p>
  
  <p>All the <strong>DateTime</strong> fields I fetch from the CRM-Soap-Service are set to the local client timezone. For instance +1 for Central Europe Standard Time.  </p>
  
  <p>But users can set their own TimeZone in Dynamics CRM, so I have to convert the local TimeZone, retrieved by Service to the users setting TimeZone (for instance (GMT-06:00) Central America)</p>
  
  <p>All meta data of the users setting for TimeZones I can fetch from CRM are:</p>
  
  <pre><code>{
      "name": "timezonecode",
      "type": "Int32",
      "value": "256"
  },
  {
      "name": "userinterfacename",
      "type": "String",
      "value": "(GMT+10:00) Canberra, Melbourne, Sydney (Commonwealth Games 2006)"
  },
  {
      "name": "standardname",
      "type": "String",
      "value": "Canberra, Melbourne, Sydney (Commonwealth Games 2006)"
  },
  {
      "name": "timezonebias",
      "type": "Int32",
      "value": "360"
  },
  {
      "name": "timezonedaylightbias",
      "type": "Int32",
      "value": "-60"
  },
  </code></pre>
  
  <p>Dynamics CRM doesn't provide me well formed meta data to simply convert the current timezone. Maybe I can handle with setMinutes() of the Date() object, but that does not change the TimeZone in the Object itself. It's still (GMT +1) though I added 180 Minutes.</p>
  
  <p>moment.js is allowed :-)</p>