Skip to main content
Solved

What timezone does the API return data in?


Forum|alt.badge.img+2

Hi,

I am using the metric export API and I was wondering what timezone the data is in.
https://developers.klaviyo.com/en/reference/metric-export

I
understand that the reports in the UI are formatted according to the organisations timezone setting but what about data out of the API?
I am assuming that all dates in the API are a set timezone and there is no way to manipulate this?  Is it UTC?

If I set the start_date and end_date in the API call in the response it comes back with no time allocations.  Is the end date inclusive of the whole day
Example:
&unit=day&start_date=2022-05-01&end_date=2022-05-02
The response returns
"start_date": "2022-05-01 00:00:00",
"end_date": "2022-05-02 00:00:00",

I assume the data returned is the end_date up to "2022-05-02 23:59:59" ?

Changing the unit to hour doesn’t return time stamps with a timezone so it isn’t obvious what timezone those hour metrics are.
 

Thanks

Best answer by Taylor Tarpley

Hi @Sayers,

 

Welcome to the Community! Happy to help! 

 

You’re absolutely right! The date timestamps that are pulled out of Klaviyo via API are displayed in Coordinated Universal Time (UTC), regardless of the timezone your account is set to. 

 

Thanks for participating in the Community!

-Taylor 
 

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

Taylor Tarpley
Community Manager
Forum|alt.badge.img+60
  • Community Manager
  • 2148 replies
  • Answer
  • June 30, 2022

Hi @Sayers,

 

Welcome to the Community! Happy to help! 

 

You’re absolutely right! The date timestamps that are pulled out of Klaviyo via API are displayed in Coordinated Universal Time (UTC), regardless of the timezone your account is set to. 

 

Thanks for participating in the Community!

-Taylor 
 


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 2 replies
  • June 30, 2022

Hi Taylor,

 

Thank you for confirming that.


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 2 replies
  • June 30, 2022

I will have to move to using the timeline API [0] in order to get data with hours so that it could be converted to any other timezone in the future.

The export API [1] units only go as granular as day unfortunately.

 

[0] https://a.klaviyo.com/api/v1/metric/{metric_id}/timeline

[1] https://a.klaviyo.com/api/v1/metric/{metric_id}/export