Skip to content
Snippets Groups Projects
Commit e35e4cbd authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fixed date format for google sitemaps

darcs-hash:20051127110118-7ad00-691b4d529004ef0571896c3d326361970a584409.gz
parent 8b9da5a7
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......@@ -125,6 +125,21 @@ function runSitemapper(){
return true;
}
/**
* 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
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment