API - times/time zones not acting as expected for deal closedate (Python)
For the deal’s create endpoint (deals/v1/deal), we are sending our time over for close date as UTC milliseconds with no off set as your API docs say. We are also using the key “closedate” as name in the JSON body and all other info in the deal creation is correct.
Python Code for time: int(datetime.utcnow().strftime("%s")) * 1000
However, create date always has 7 hours added to it (screenshot below).
API - times/time zones not acting as expected for deal closedate (Python)
Apologies, the error was actually on our end.
For anyone having a similar problem in the future: doing .timestamp or .strftime on the timezone unaware object returned by datetime.utcnow() causes the time to convert to OS local time.
To fix this either use datetime.now(tz=None) or django’s timezone.now().
Can you provide a link to the contact record in this screenshot? And if possible, could you provide the request that was made to update this deal property? I’d like to take a closer look at this specific example.