I'm really confused in timezones.
All the DateTime fields I fetch from the CRM-Soap-Service are set to the local client timezone. For instance +1 for Central Europe Standard Time.
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)
All meta data of the users setting for TimeZones I can fetch from CRM are:
{
"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"
},
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.
moment.js is allowed :-)