From c4f79b71351dd0d96f19f7c5629888d85a814c72 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Wed, 7 Apr 2010 11:31:50 +0200 Subject: Sitemap rewrite --- inc/common.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index bf5987c28..0816d9fbb 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1266,6 +1266,21 @@ function dformat($dt=null,$format=''){ return strftime($format,$dt); } +/** + * Formats a timestamp as ISO 8601 date + * + * @author + * @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; +} + /** * return an obfuscated email address in line with $conf['mailguard'] setting * -- cgit v1.2.3