News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stefan Koopmanschap's Blog:
Formatting valid xsdateTime fields with PHP
September 09, 2009 @ 09:19:15

Stefan Koopmanschap had a problem - the formatting on his dateTime fields (the XSD type) wasn't cooperating and couldn't be validated. He asked the question of the community of how to correct this and was given a short and easy answer from David Zuelke using date.

Recently I had to compose some XML documents that needed to be validated with XSDs. All fine of course, but I had some problem with two date/time fields that according to the XSD were supposed to be xs:dateTime fields. Googling around I found a lot of references to the ISO8601 format, so I decided to format my date using the DATE_ISO8601 constant. That did not work though.

David's suggestion was to use "date('c')" (the full ISO 8601 date) instead of the DATE_ISO8601 constant. The trouble is caused by a missing colon in the second choice's output.

0 comments voice your opinion now!
format valid xsd datetime


blog comments powered by Disqus

Similar Posts

Christian Schaefer's Blog: Beware of the timezone! Working with PHP DateTime & Doctrine for MongoDB

Derick Rethans' Blog: Calculating start and end dates of a week

Rafael Dohms' Blog: Book Review: Guide to Date and Time Programming

XPertDeveloper.com: Is Your PHP Application Affected by the Y2K38?

ThinkPHP Blog: Put out the age of a date in words


Community Events





Don't see your event here?
Let us know!


release introduction interview tips bugfix community framework update api package install series opinion language zendserver podcast deployment library symfony laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework