APIs & Integrations

kaleperez
Participant

Problem to upload the date picker property

When I send an specific date picker property update converted in UnixTimeMilliseconds, HubSpot shown the date with one day less. I don't know what's the cause of this.

 

I tried different methods to convert the date to UnixTimeMilliseconds. I also included the UTC just in case, but the problem continues. Sometime the date is including correctly and other time is including with one day less. 

 

This is an example the method that I use to convert the date:

 

DateTimeOffset.Parse(mydate.FromUTC("Central Standard Time").ToString()).ToUnixTimeMilliseconds().ToString()

 

Thanks in advanced for your help

0 Upvotes
6 Replies 6
webdew
Guide | Diamond Partner
Guide | Diamond Partner

Problem to upload the date picker property

Hi @kaleperez ,

Hubspot Accept below format to store data. please passed below code of php.
<?php
$time = time() * 1000;


OR

<?php
$myDate = new \DateTime('m/d/Y', new \DateTimeZone('UTC'));
$hubSpotDate = $myDate->format('Y-m-d g:i a');

?>


Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes
kaleperez
Participant

Problem to upload the date picker property

Thanks for this solution. Do you have any solution using c#?. We don't use php code in our site.

 

I just test using only date, deleting the time, but it still not working.

 

DateTimeOffset.Parse(myDate.ToShortDateString()).ToUnixTimeMilliseconds().ToString()

 

Thanks.

 

 

 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Problem to upload the date picker property

@gotmike 

Could you assist?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Problem to upload the date picker property

@miljkovicmisa , feel like helping a out a friend in need?

0 Upvotes
miljkovicmisa
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Problem to upload the date picker property

👋 @dennisedson and @kaleperez, I would love to help but unfortunately C# is not my thing, all I can do is JavaScript and PHP...
dennisedson
HubSpot Product Team
HubSpot Product Team

Problem to upload the date picker property

You have the weekend to get up to speed, sir 😉