API View has issues with timezones

Comments

4 comments

  • Andreas Haugstrup Pedersen

    Are you authenticating using app authentication or are you authenticating as a user?

    0
    Comment actions Permalink
  • Jon Hatto

    Hi Andreas, I think it's app auth: Podio::authenticate('app', array('app_id' => $app_id, 'app_token' => $app_token));

    0
    Comment actions Permalink
  • Andreas Haugstrup Pedersen

    When you authenticate as an app all dates and times will always be in UTC because apps don't have a timezone attached (only Podio users do). You can specify an absolute date in your filters to compensate.

    0
    Comment actions Permalink
  • Chang Huang

    Do we have any update on this issue?

    I have a custom view of items filtered by month (not using "current month" but the calendar picker by selecting the first day and the last day of the month). The timezone is set to America/Santiago. The date comes back as UTC when authenticating using app.

    The problem is the conversion from American/Santiago to UTC is done before my custom view is filtered. For instance, an item with a date of 31/01/2016 21:00 America/Santiago -3, which should be in the my view of January, after the API call, it gets placed incorrectly into February (01/02/2016 00:00 UTC).

    What is the best way to solve this? Wouldn't it make more sense to do the conversion after the items have been filtered? That way the API returns exactly the same items as in the app, even if the results end up in a different timezone, in this case UTC. Then I can just change it back to America/Santiago using something like Moment.js.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk