You need to sign in to do that
Don't have an account?
EvanAlter
What is the valid DateTime format for PHP?
I have been trying to create an Event with PHP for a week now and I keep running into dead ends. Now that I think I finally got it working with the SalesforceClient.php I am getting back and invalid dateTime type. However I used the same format that salesforce returned the dateTime to me in.
Here is the error.
stdClass Object ( [errors] => stdClass Object ( [fields] => [message] => ActivityDateTime: value not of required type: 2005-01-02T21:12:00Z [statusCode] => INVALID_TYPE_ON_FIELD_IN_RECORD ) [id] => [success] => false )
best I can tell 2005-01-02T21:12:00Z is the right format
Here is the error.
stdClass Object ( [errors] => stdClass Object ( [fields] => [message] => ActivityDateTime: value not of required type: 2005-01-02T21:12:00Z [statusCode] => INVALID_TYPE_ON_FIELD_IN_RECORD ) [id] => [success] => false )
best I can tell 2005-01-02T21:12:00Z is the right format
I've not had a direct answer to that, but I've found that gmdate(DATE_ISO8601) works (I'm using PHP 5.1): http://www.php.net/manual/en/ref.datetime.php
<activityDateTime xsi:type="xsd:string">2005-05-05T12:22:00Z<activityDateTime>
you'll get the above error, because the xsi:type attribute says the value is a string when it should be a dateTime.