Post

3 followers Follow
0
Avatar

Podio timezone

Hey,

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?

Mathieu Smith

Please sign in to leave a comment.

6 comments

0
Avatar

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?

Henrik Huhtinen 0 votes
0
Avatar

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?

Mathieu Smith 0 votes
1
Avatar

Hi Mathieu,

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.

br
Marek

 

Marek Hruzik 1 vote
0
Avatar

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?

-Mark

Mark Cannon 0 votes
0
Avatar

Hi Mark,

I am not a php user and I don't know the internals of podio-php. You will have to test it I guess. 

br
Marek

Marek Hruzik 0 votes