Date Picker setting in PHP


#1

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


#2

Hi @himanshu,

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


#3

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