I'm calling a SOAP web service that expects to receive a date/time in XMLGregorianCalendar format. So, for example, I would need to convert YYYY-MM-DD HH:MM:SS to that format.
When I retrieve data from the web service, I would need to convert date/time from XMLGregorianCalendar format to YYYY-MM-DD HH:MM:SS.
I would normally post some code that I have tried but, in all honesty, I'm having trouble locating anything to even get me started with PHP. So my apologies for the lack of sample code. Would REALLY appreciate any guidance.
The date format used in XML is ISO-8601. You can use strftime to convert it to a Unix timestamp and date to convert it back to a nice readably sting.
These format string might come handy:
You can check supported time formats of strtotime here: http://de3.php.net/manual/en/function.strtotime.php
And syntax for date here: http://www.php.net/manual/en/function.date.php
$date = date("Y-m-d H:i:s", strtotime($date)); // Output as datetime used in SQL
$date = date("c", strtotime($date)); // Output as datetime used in XML