Websockets API provides incorrect timestamps?

  • 1
  • Problem
  • Updated 5 months ago
I'm in the timezone America/Chicago, and despite that timezone showing correctly in data received from the websocket events, the actual timestamp is 6 hours off. For example, at 5:23pm this evening I received an event with the following attributes:

time_zone: 'America/Chicago'
created_at: '2017-11-07T23:23:06.00Z'

So the timestamp says 11:23pm when it should say 5:23pm.

My temporary workaround has always been to just subtract 6 hours from the websocket event timestamp. However, it's a pain, because every time our clocks adjust for daylight savings (this past weekend), I have to edit my code to change the number of hours adjustment (the websocket timestamp doesn't shift with daylight savings).

In summary: I would expect the websocket event time_zone to match created_at, and if the time zone honors DST, then the timestamp should too. In other words, I shouldn't have to do workarounds in my code for this.

Help! :)
Photo of Matt Farley

Matt Farley

  • 1,464 Points 1k badge 2x thumb

Posted 7 months ago

  • 1
Photo of Derrick S.

Derrick S., Official Rep

  • 7,074 Points 5k badge 2x thumb
Hi Matt,

Please contact developer@automatic.com for assistance with this issue, thanks! 
Photo of Matt Farley

Matt Farley

  • 1,464 Points 1k badge 2x thumb
What's the point of having these forums if others can't benefit from answers and solutions from Automatic? Doesn't that defeat the purpose of hosting a public help forum if everything is solved in private email? Doesn't make sense to me.
Photo of Matt Farley

Matt Farley

  • 1,464 Points 1k badge 2x thumb
I emailed developer@automatic.com a week ago and haven't received any response. What's going on?
Photo of Derrick S.

Derrick S., Official Rep

  • 7,074 Points 5k badge 2x thumb
Hi Matt,

Sorry to hear that they haven't responded. The reason we can't help you is because that is a completely different team from Customer Care. I would recommend emailing them again.
Photo of Matt Farley

Matt Farley

  • 1,464 Points 1k badge 2x thumb
Thanks Derrick! .. it's a shame that this online forum isn't used like most other sites -- as a place where people can actually get help :(
Photo of Justin Rodino

Justin Rodino

  • 820 Points 500 badge 2x thumb
Matt,

I've been working a lot lately with the APIs and the JSON passed, and from what I gather, the timestamp is always UTC and the timezone is the timezone the adapter is in or possily the timezone of the user themself.

Justin
Photo of Justin Rodino

Justin Rodino

  • 820 Points 500 badge 2x thumb
Matt, I can confirm it is in fact an epoch timestamp now and the timezone is the timezone of the adapter. I tested this as I went on a trip from the Eastern Time Zone yesterday to the Central Time Zone and infact inside the trip file were two epochs and two time zones.
Photo of Matt Farley

Matt Farley

  • 1,454 Points 1k badge 2x thumb
Thanks Justin!!