Formatting valid xs:dateTime fields with PHP

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.

After quite some time puzzling on the issue I decided to just fire off my problem to Twitter.

Question

Awesome as Twitter is for these kinds of things, I had my answer very soon:

Answer

Apparently the DATE_ISO8601 is missing the ":" in the timezone offset, and the solution is very simple:

date('c' );


According to the PHP manual, the 'c' string also gives the ISO 8601 formatted string. However, this one is correct and working. Thanks to David Zuelke for giving me this answer, as it ensured my progress in this specific task :)


Add comment

Comments

gravatar mp3 player rca: features: cd/mp3/usb player with usb-midi computer interface play kid kids-cd20 designed for atrac cd players!cheap cd clearing out cd time. the microsoft zune hd is a great mp3 player. model:video cd 2.0 esp squared compact design high speed search multi digital effect.
February 28, 2013
gravatar Sample Second Job Interview Thank You Letter: they are responsible for monitoring the patient's ailment by means of bodily assessments, documentation of his well-being historical past, and referring the circumstances to the apt wellbeing treatment providers. 7. this translates into lowered mal practice rates which only helps to creates more openings for medical analysts who work in medical billing offices.
March 11, 2013
gravatar photometry astronomy: nothing good is gained without sacrifice. i welcome you all to tour this awesome village with me. barometric pressure hourly averages. daily word quiz: calumny.
May 15, 2013
gravatar Amana Adb1200aw 24 In Built-in Dishwasher: microwaves are of short wavelength with high frequency. one reviewer commented that the le cube is very solidly constructed, makes great espresso, and is much better than he thought it would be. always use a residential garage approved heating appliance, especially for attached garages. what are the top two or three brands to consider? where is the best place to buy your pipe? what type of cabling needs to be installed in the walls of your house? you are going to need a ebook to guide you through the process.
May 15, 2013
gravatar ph meters beckman: on a brookfield viscometer using a no. gentle spin the hydrometer to release any air bubbles. auto scan tweezers digital multimeter smd meter yellow (2*aaa).
May 23, 2013

Php5_zce_logo

Tags

1337 2008 2010 2011 4developers access modifiers accessibility AdaLovelaceDay09 advent agavi agile alfred amsterdam amsterdamphp apache api apple article articles atk atkMetaNode audioscrobbler autoloading automation azure backwards compatibility barcelona barcodes bash bbc bbq beatstad belgium best practices bittorrent blogging blogs boards of canada book books bughuntday bundle caching cake cal evans calendar career cat cerf certificate cfp cilex clear cms cologne common sense communities community components composer conference conferences contest continuous integration contribute contribution crisis css curl custom d-day data migration datetime DbFinderPlugin decorator decorators deployment deps devdays development directoryindex directoryiterator docblox doctrine doctrine2 documentation download dpc dpc09 dpc10 dpc11 DPC2008 dreamhost drupal dv7 eclipse ed editors efficiency enterprise errors event events expertise ezcomponents facebook filter-branch filteriterator finland flickr fork framework frameworks free ticket freelance freeze frontend fun game games geoip germany getting real git github globiterator gnome-do google google calendar googletalk graceful degradation hack hackers hidden gem hiphop howto hp HR html http i386 ibuildings icann ide ideasofmarch idm imovie inclusivity indy ingewikkeld integration international php conference internet interview ipad IPC ipc ipc08 ipc10 ipc11se iterators iterm2 javascript jenkins jenkins-php job job openings jobeet john peel joomla joomladays kiva kubuntu launcher launchy left on the web libcurl libraries library lighttpd lime linktuesday linux live london loudblog m2ts mac magazines malware mambo manchester marjolein mediterra meeting meme meta methodology micro-financing microframework microsoft migration movie music mysql namespace namespaces netbeans netherlands newsfire nllgg northeastphp nos odmarco open source opinion ORM osx paradiso paris partnership pavilion pear pecl performance personal pfc10 pfc11 pfcongres pfcongrez pfz pfz.nl photo php PHP php5.3 phpabstract phpazure phpBB phpbb phpbelgium phpbenelux phpbnl10 phpday phpdoc phpdocumentor phpgg phpitalia phpnw phpnw08 phpnw11 phpnw12 phpstorm phptek phptek09 phpuk2009 phpUnderControl phpunit php|architect php|tek podcast politics portability postcrossing presentation presentations private projects protected prototype PSR-0 public python qa qr codes re2c recruiting refactoring review rewrite ruby on rails san francisco schedule scifi script security sensio seven things sexism sfdaycgn sflive2011 shell scripting silex simplexml slides smfony software sogeti solar sound speakers spl ssh standard standards star trek static steer strings stylesheets subversion symfony symfony live symfony2 Symfony2 symfonycamp symfonyday symfonylive symfonyUnderControlPlugin talk talks tech techademy technology techportal tek09 telecommuting terratec terrorism testfest testing textmate textpattern the right tool timeout tips tld todo tomas tools training twig uncon unet usability usergroup validation vhost video vim vinyl virus warp webinar weblogging webservices wiki windows winphp women wordpress work workshop world world of warcraft wpi writing wunderlist xml xpath xsd yara year youtube zc11 ZCE zemanta zend zend framework zend server zend studio zendcon Zend_Form zite
© 2004 - 2013 Stefan Koopmanschap + Powered by Symfony, photos powered by Flickr, links powered by Delicious, Shanghai smilies by Iconbuffet. Feeds: rss / atom. Left on the Web v4.4.0.1