I would say your host running the API integration sets the timezone. Might vary though depending if you authenticate as an user or an app. I call "date_default_timezone_set('UTC');" in the beginning of my API scripts. If you want to use a different timezone, just set it in the script?
When creating an item with a datetime field manually in Podio, the field timezone is the same as configured on current user account.
Is it the same thing when we create item trough the API?
I have webhooks on two orgs, with different creator/owner. I authenticate with a Podio account which its timezone is "America/Montreal".
When I use the API to create an item with one of the orgs, I must add 5 hours to current time (which is UTC by default on Podio), because the final datetime value (once the item is created in Podio) is not the same as expected.
Example: The input is 2016-03-03 12:00:00, in Podio the input is now: 2016-03-03 07:00:00
Does the timezone is defined by the space/org creator/owner?
Please sign in to leave a comment.
I already set the timezone at the beginning of my script and the issue persist, thanks for the tip, Henrik!
Do you know if there's any difference on the current timezone between app and user authentication?
If you authenticate as a user then the timezone in the API request is assumed to be in that user's timezone (account settings).
If you authenticate as an app then timezone is UTC.
Thanks a lot for your answer, Marek!
Your answer helped me a lot!
Marek and Henrik,
If you call "date_default_timezone_set('UTC');" after the authentication, would it always set the timezone to UTC for either authentication?
I am not a php user and I don't know the internals of podio-php. You will have to test it I guess.