diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exe/indexer.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 2eea32f02..2680d161a 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -113,7 +113,7 @@ function runSitemapper(){ print ' <url>'.NL; print ' <loc>'.wl($id,'',true).'</loc>'.NL; - print ' <lastmod>'.date('Y-m-d\TH:i:s',$date).'</lastmod>'.NL; + print ' <lastmod>'.date_iso8601($date).'</lastmod>'.NL; print ' </url>'.NL; } print '</urlset>'.NL; @@ -126,6 +126,21 @@ function runSitemapper(){ } /** + * Formats a timestamp as ISO 8601 date + * + * @author <ungu at terong dot com> + * @link http://www.php.net/manual/en/function.date.php#54072 + */ +function date_iso8601($int_date) { + //$int_date: current date in UNIX timestamp + $date_mod = date('Y-m-d\TH:i:s', $int_date); + $pre_timezone = date('O', $int_date); + $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2); + $date_mod .= $time_zone; + return $date_mod; +} + +/** * Just send a 1x1 pixel blank gif to the browser * * @author Andreas Gohr <andi@splitbrain.org> |