Is there a particular format I should use when exporting a DateTime value for the PHP API library?
I am creating deals via the API v3 CRM Deals endpoint using the PHP library.
I seem to be unable to set the closedate property for my deals and suspect this may be due to the datetime format that I am providing.
- CLASS: \HubSpot\Client\Crm\Deals\Api\BasicApi.php
- METHOD: create($simple_public_object_input)
The create example in the API Developer Docs provides the following value when setting the closedate:
- “closedate”: "2019-12-07T16:50:06.678Z
- Accounts Dashboard | HubSpot
This format doesn’t seem to quite align with the DateTimeInterface::ATOM constant in PHP:
- const string ATOM = “Y-m-d\TH:i:sP”
- example: 2005-08-15T15:52:01+00:00
- PHP: DateTimeInterface - Manual
Should I instead export the DateTime value as a UNIX_TIMESTAMP, multiply that value by 1000 to add milliseconds, and provide that number to the PHP library?
Or should I simply supply a raw DateTime object and trust that the PHP Library will take care of the export format for me?