diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-11-27 12:01:18 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-11-27 12:01:18 +0100 |
commit | e35e4cbd1e93fb350d9ed782597d68f5a3df5db8 (patch) | |
tree | 40ab15b5cd1003bfde7c628c9bb39cd9cce554b6 /lib/exe/indexer.php | |
parent | 8b9da5a7173ccde168f612b798f2af2a82d125fc (diff) | |
download | rpg-e35e4cbd1e93fb350d9ed782597d68f5a3df5db8.tar.gz rpg-e35e4cbd1e93fb350d9ed782597d68f5a3df5db8.tar.bz2 |
fixed date format for google sitemaps
darcs-hash:20051127110118-7ad00-691b4d529004ef0571896c3d326361970a584409.gz
Diffstat (limited to 'lib/exe/indexer.php')
-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> |