XML Sitemap Date Format In PHP
Published by philipnorton42 on Fri, 04/03/2009 - 11:49To format the current timestamp in W3C Datetime encoding (as used in sitemap.xml files) use the following parameters.
echo date('Y-m-dTH:i:sP', time());
As of PHP5 you can also use the c format character to print the exact same string.
echo date('c',time());
These would both print out the following:
2009-04-03T11:49:00+01:00
Category:
Comments
Test, just a test
waypsublisbub (not verified) - Sat, 02/19/2011 - 02:43Add new comment