Blog, Website & Page Publishing

kainmarko
Mitglied

Insert date to form via curl

lösung

Hi everyone, 

I have made a php script to insert data into a hubspot form. The text data inserts them well however the dates do not insert them.

The format expected is the European dd / mm / YYYY, I write it by hand to test it and neither is able to read that date and insert it.
This is an example "& date_of_born =". urlencode ("03/01/2000").

Can you help me with this topic?

0 Upvotes
1 Akzeptierte Lösung
kainmarko
Lösung
Mitglied

Insert date to form via curl

lösung

Hi @roisinkirby, it is over, the date expected by hubspot is time in miliseconds on timestamp format like 3500000000 and the hubspot show it like a human readable date.

That is 

$fecha_ = date_create( date($fecha), timezone_open( 'UTC' ) )->getTimestamp();
return $fecha_*1000;

Thanks.

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
2 Antworten
roisinkirby
HubSpot-Produktteam
HubSpot-Produktteam

Insert date to form via curl

lösung

Hey @kainmarko can you pleae share a link to the page/form you are working on? Is this an embedded form and/or are you using HubSpot's Form API?

0 Upvotes
kainmarko
Lösung
Mitglied

Insert date to form via curl

lösung

Hi @roisinkirby, it is over, the date expected by hubspot is time in miliseconds on timestamp format like 3500000000 and the hubspot show it like a human readable date.

That is 

$fecha_ = date_create( date($fecha), timezone_open( 'UTC' ) )->getTimestamp();
return $fecha_*1000;

Thanks.

0 Upvotes