While creating new item or updating existing item using Podio API, and setting DateTime field value to: 2016-10-21 14:15:00
(as example). Which timezone will be used to store this DateTime?
E.g. request:
app_id = <some app with title and date fields>
content = {'title' => 'Date set to "14:15"',
'date' => {'start' => '2016-10-21 14:15:00',
'end' => '2016-10-21 15:00:00'}}
item = Podio::Item.create(app_id, 'fields' => content)
Result:
'start_date_utc' => 2016-10-21
'end' => 2016-10-21 15:00:00
'end_date' => 2016-10-21
'end_date_utc' => 2016-10-21
'start_time_utc' => 12:15:00
'start_time' => 14:15:00
'start_date' => 2016-10-21
'start' => 2016-10-21 14:15:00
'end_time' => 15:00:00
'end_time_utc' => 13:00:00
'end_utc' => 2016-10-21 13:00:00
'start_utc' => 2016-10-21 12:15:00
Which is great, because I'm seeing same time value 14:15
as I've set 14:15
, but how can I control and set specific timezone to this DateTime field?
It appears that Podio API is pretty smart and is aware of my timezone.
Here are couple of examples with requests and results. Setting DateTime field to
14:15:00
being authenticated as different users and as app.Then values set are:
Then value
2016-10-21 14:15:00
is treated by API as2016-10-21 14:15:00 +0200
because userA timezone is set to UTC+02, and same value is treated by API as2016-10-21 14:15:00 -0700
because userB timezone is UTC-07 (inside Podio, in account settings). And if authenticated as app, then assumed timezone is UTCSo, if I want to set value
2016-10-21 14:15:00 +0800
(let's pretend I want to set timezone of Kuala Lumpur), then I will have to convert it first to my own timezone (whatever is set in Podio account settings), and then send to Podio API, like this: