Date Picker setting in PHP


I have created a Deal Property “test start date” and type is “Date Picker”. However when I set the value via PHP code it always crashes. I tried like this
$date = new DateTime(‘02/31/2011’);
and setting it like this
"value" => $date,
“name” => "test_start_date"
The code is crashing all the time. Can you please give an example how to set the via code a datepicker type property


Hi @himanshu,

HubSpot API endpoints accept UNIX formatted timestamps in milliseconds. How exactly is the $date object formatted?


Thanks I fixed it. I overlooked that the timestamp should be set for midnight.