Sitemap is important file and route for SEO tools. The sitemap should be standard XML format. Sitemap contains few xml tags which should be in proper format. You can find more details about sitemap at this article.
<lastmod> tag which shows date of last modification of the file. This date should be in W3C Datetime format.
To format the standard date format in PHP,use the below parameters in
<?php echo date('Y-m-dTH:i:sP', time());
As of PHP5 you can also use the c character to print the exact same string.
<?php echo date('c',time());
These both code will print date as per sitemap format.
Was this article helpful?
Leave a comment
Copyright 2021 HackTheStuff