APIs & Integrations

AlaPrechtl
Member

Update a deal's datetime property

Hi everyone,

I want to update a deal's property via API and it always tells me I need to set it to midnight.

I did so and found out, that it has to be UTC midnight. Can someone help me to figure out how to do that?

 

I have a unix time value as a string and try to do the following before adding it to the post data for the request:

 

dt_object = datetime.fromtimestamp(int(unix))
dt_object = datetime.combine(dt_object, datetime.min.time())
unix = str(int(datetime.timestamp(dt_object)))

Thanks!

0 Upvotes
1 Reply 1
WendyGoh
HubSpot Employee
HubSpot Employee

Update a deal's datetime property

Hey @AlaPrechtl,

 

When looking to convert timestamp to UTC midnight, you can refer to these resources: 

datetime - Converting local timestamp to UTC timestamp in Java - Stack Overflow

Java Service to convert Epoch Time to Simple Date Time Format - Software AG Wiki - Software AG Commu...

 

Hope this helps and do let me know if you'd like further clarification on this!

0 Upvotes