Open ZhangChengLin opened 3 years ago
If $lastModified is not in integer format but in string format, there is no need to format it.
Currently it assumes UNIX timestamp only but yeah, could be expanded to support cutom format. That adds a possibility to generate incorrect sitemap though...
Currently it assumes UNIX timestamp only but yeah, could be expanded to support cutom format. That adds a possibility to generate incorrect sitemap though...
Something wrong? why?
It is not wrong per se. Just need to add validation if you're going to accept strings as well. Want to make a pull request?
https://github.com/samdark/sitemap/blob/17dc5602e817d7f16b03c476569fb38e2de48156/Sitemap.php#L259 https://github.com/samdark/sitemap/blob/master/Sitemap.php#L305 https://github.com/samdark/sitemap/blob/master/Sitemap.php#L354
Can the output format of the lastmod tag support Y-m-d For example, if it is not an integer format parameter, let him use it directly as a string.