APIs & Integrations

RDeVargas
Member

API Post date in Unix Epoch milliseconds during Daylight Savings change

Ok, after the initial shock of having to convent a simple date into Unix milliseconds format for the UTC time of 12:00 AM (good grief!), now I'm running up against it screwing up during the Dayligh Savings time changes in Fall and Spring in the U.S. During these events, the 12:00AM time becomes either 1:00AM or 11:00PM, depending on the direction of the change.

Can anyone help me out with an algo to resolve this? Is it me, or does the location of the server play into this? And whether the server time itself has already changed? And whether the date in question is BEFORE or AFTER the "Spring-forward/Fall-back" date? 

0 Upvotes
2 Replies 2
RMones
Contributor | Platinum Partner
Contributor | Platinum Partner

API Post date in Unix Epoch milliseconds during Daylight Savings change

Hi @RDeVargas ,

 

@dennisedson is right.

 

The definition of UNIX timestamp is timezone independent. The timestamp is the number of seconds (or milliseconds) elapsed since an absolute point in time, midnight of Jan 1 1970 in UTC time. (UTC is Greenwich Mean Time without Daylight Savings time adjustments.) 

 

https://en.wikipedia.org/wiki/Unix_time

 

Kind regards,

 

Ronald

dennisedson
HubSpot Product Team
HubSpot Product Team

API Post date in Unix Epoch milliseconds during Daylight Savings change

Hi @RDeVargas ,

The unix timestamp itself  if time zone and daylight savings time independent. 

Maybe this answer would be helpful?

@Mike_Eastwood@RMones  maybe you all have some extra advice?

0 Upvotes