Hello, i’m trying to figure out how to send a time stamp correctly to a datepicker property. I’ve done some research on here but can’t really find a answer.
Here’s what I got:
$time = 1632182399;
I had did some research and found a contributor had suggested this solution: https://community.hubspot.com/t5/APIs-Integrations/Update-Custom-Date-Picker-in-Deals-through-the-API/m-p/229499
But this doesn’t actually work and I don’t know why. Perhaps I’m calling it wrong? This is what I was trying:
function get_time_for_hubspot($time){
$date = new DateTime();
$date->setTimestamp($time);
return gmdate('Y-m-d H:i:s', strtotime($date->format('Y-m-d H:i:s')));
}
// Time Stamps $starttime = strval($booking_object->start); $endtime = strval($booking_object->end); $starttime = get_time_for_hubspot($starttime); $endtime = get_time_for_hubspot($endtime);
Which produces:
$starttime = 2021-09-13 00:00:00
$endtime = 2021-09-13 23:59:59
Thanks for any help.