Date not accepted by API - timezone problem ?
3 weeks ago
Hello, I'm have a problem posting date values to HS via the API.
HS is setup with a custom property with the field type set to 'Date picker'.
As an example, the date I'm trying to push is 1 Sept 2020 BST (that's UTC+1)
which is equivalent to 31 Aug 2020 23:00 UTC
The HS documentation states timestamp should be UTC so it makes sense to me to base the Unix timestamp calculation off the UTC date (31 Aug 23:00 and not 1 Sep). This converts to 1598914800000 (milliseconds).
Note: calculated in C# and doubled checked with https://www.unixtimestamp.com
The problem is the timestamp is rejected by the HS Api.
The only way I can get this to work is to use the date 1 Sept and treat as UTC (but its not!) and post the ts for this ie 1598918400000
Can someone clarify what the correct approach is, I'm unsure How this will handle timezone changes eg when BST ends.