Recent searches


No recent searches

In what timezone is the unix timestamp interpreted, GMT or the Zendesk instance timezone ?



Posted Dec 18, 2024

Hello,

 

Thank you for giving me access to this API.

 

I've started experimeting with it and I want to understand exactly which 24 hours are included when I enter a Unix timestamp, with regards to timezones.

 

Let's take a practical example . 

 

The timestamp 1734488584 corresponds to early 18th December in GMT and late 17th December in EST (which is the timezone configured in my Zendesk settings).

 

If I send a request with that timestamp in both startTime and endTime parameters, will the result covers the whole 18th of december in GMT or the whole 17th December in EST ?

 

I could certainly figure the answer out by running tests but timezones give me headache and as we're still configuring WFM, I don't have users generating data to help those tests (and don't know of another way to generate time entries).

 

Thank you,

Fares


0

7

7 comments

Hi Fares,
 

Thank you for reaching out via the community forum! Your question is valuable and can help other WFM API users who may have similar concerns.


To clarify, our database operates in UTC, which is the reference time for all timestamps. When you enter a Unix timestamp, it is interpreted in UTC. Using your example  (startTime: 1734488584) it would mean that:
 

  • UTC: December 18, 2024, 00:03:04 to December 19, 2024, 00:03:04 (24h)
  • GMT: December 18, 2024, 00:03:04 to December 19, 2024, 00:03:04 (24h)
  • EST: December 17, 2024, 07:03:04 PM to December 18, 2024, 07:03:04 (24h)


I hope this helps clarify your concerns regarding timezones! If you have any further questions, feel free to ask.

Samanta
 

0


Hello Samantha,

 

Thank you for the answer. So the API returns the full UTC day.

 

In that case, how can I use the API to get the data for a single EST day ? Is it not possible at this stage ?

 

Thank you,

Fares

0


Hello Fares,


While the API returns data for a full UTC day, you can still retrieve data for a single EST day by using specific UTC timestamps. Here's how you can do it:

Example for January 6th, 2025 (EST), the start and end UTC timestamps would be:

  • Start: 1736139600 (equivalent to January 6, 2025, 00:00:00 EST)
  • End: 1736225999 (equivalent to January 6, 2025, 23:59:59 EST)

By including these timestamps in your request, you'll effectively retrieve data for a single day in EST.

Let me know if you have any further questions or need assistance!


Best regards,

Samanta

0


Hey Samantha,

 

The documentation I received specifies the following : 

 

 

Additonnaly, when calling the endpoint with a different start and end time parameters, I get an explicit error :

 

  "message": {

    "startTime": [

      "The start time field must be a date equal to end time."

    ]

 

What am I missing in this case ?

 

Thank you,

Fares

0


Hi Fares, 

 

Taking into consideration that your startTime UTC is  1736139600 (which is equal to January 6, 2025, 00:00:00 EST), 1736139600 needs to be your start and end time, but in the API response if you have a timestamp equal or higher to 1736225999 then you know that, that will be already the 7th!

Hope this helps! 
Samanta

0


Hi Samantha,

 

So you are saying if I want to get a single EST day I have to send two request for two UTC days and then work the code to extract from those two responses the portion that is my single EST day ?

 

I hope you can see how unwieldy and unusable this is for anyone not living in UTC.

 

Fares

0


After reviewing the most recent logic on how we deal with timezones and API calls, this is how it behaves today:

1. Reports Endpoint:
 

  • The startTime timestamp now respects the timezone of the report.
  • For example, if your report is configured in Sydney timezone and you provide a Unix timestamp for 00:00 Sydney time on the 6th, the response will reflect data in Sydney timezone.
  • Additionally, if you provide a timestamp within the day (e.g., 05:00), the system adjusts to include the full day, from 00:00 to 23:59 in the report’s timezone. This ensures the report always covers an entire day of data, aligned to the report's timezone settings.

    This means you won't need to make 2 separate calls to cover the 24h for EST - I will also update the community topic to reflect this update


 

2. Agent Activity Endpoint:
 

  • The startTime parameter behaves differently. It includes activities starting from the given timestamp as well as activities that began earlier but were still ongoing at the specified time.
  • For example, if you request data from 10:00, the response will include all activities that started at or before 10:00 and ended after 10:00.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post