Blog, Website & Page Publishing

kainmarko
Miembro

Insert date to form via curl

resolver

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 Me gusta
1 Soluciones aceptada
kainmarko
Solución
Miembro

Insert date to form via curl

resolver

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.

Ver la solución en mensaje original publicado

0 Me gusta
2 Respuestas 2
roisinkirby
Equipo de producto de HubSpot
Equipo de producto de HubSpot

Insert date to form via curl

resolver

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 Me gusta
kainmarko
Solución
Miembro

Insert date to form via curl

resolver

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 Me gusta