1

Update TimeZone and DST Value

Тема: Update TimeZone and DST Value

Hi Support,

I want to update the TimeZone and DST settings of a user and what is the correct way to achieve it ?
I am seeing a batch command was used to update it via CMS which was shown below, do I need to stick to the same batch as well ?
DST update shown below was not required I guess - Am I correct or I am missing anything here ?
Please share me proper way to update TZ and DST settings for an user - Thanks

Current API for updating TZ and DST :

{"params":
[
{"svc":"item/update_custom_property","params":{"itemId":14033536,"name":"tz","value":-134170192}},
{"svc":"item/update_custom_property","params":{"itemId":14033536,"name":"dst","value":-1}},
{"svc":"render/set_locale","params":{"tzOffset":-134170192,"language":"en","flags":257,"formatDate":"%b-%E-%Y %H:%M"}},
{"svc":"user/update_locale","params":{"userId":14033536,"locale":{"fd":"%b-%E-%Y_%I:%M %p","wd":1}}}
],
"flags":0}

2

Update TimeZone and DST Value

Re: Update TimeZone and DST Value

karthik, to update users TZ and DST parameters only first request is required (item/update_custom_property "tz").
This property contains TZ and DST parameters combined (more info and example here ).
The second request (item/update_custom_property "dst") is outdated and was added only for compatibility reasons. You should skip it.
As for third request (render/set_locale) it is used to set localization parameters to renderer of current session for correct data formatting returned from server. This request should be executed every time after login to apply user's localization parameters to renderer. Also it can be executed after changing user's localization settings (for example "tz").
The forth request (user/update_locale) has no relation to TZ and DST. It is used for setting user's date and time formatting (example yyyy.mm.dd) and for setting first day of week. In your case you can skip it.

Head of Wialon Local Department
Gurtam
3

Update TimeZone and DST Value

Re: Update TimeZone and DST Value

Thanks for the detailed explanation deal