Index: atom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/atom/atom.module,v
retrieving revision 1.22.2.8
diff -u -p -r1.22.2.8 atom.module
--- atom.module	7 May 2009 14:04:14 -0000	1.22.2.8
+++ atom.module	21 Sep 2009 00:57:05 -0000
@@ -14,6 +14,11 @@
 define('ATOM_DISPLAY_SUMMARY', TRUE);
 define('ATOM_DISPLAY_CONTENT', TRUE);
 
+// Backport of the PHP 5.1.1 and above DATE_ATOM date constant.
+if (!defined('DATE_ATOM')) {
+  define('DATE_ATOM', 'Y-m-d\\TH:i:s+00:00');
+}
+
 /**
  * Valid permissions for the atom module
  *
@@ -231,8 +236,8 @@ function _atom_print_feed($nodes, $feed_
     $output .= '    <title>'. check_plain(strip_tags($item->title)) ."</title>\n";
     $output .= '    <link rel="alternate" type="text/html" href="'. $link .'" />'."\n";
     $output .= '    <id>'. $link ."</id>\n";
-    $output .= '    <published>'. _atom_timestamp2w3dtf($item->created) ."</published>\n";
-    $output .= '    <updated>'. _atom_timestamp2w3dtf($item->changed) ."</updated>\n";
+    $output .= '    <published>'. gmdate(DATE_ATOM, $item->created) ."</published>\n";
+    $output .= '    <updated>'. gmdate(DATE_ATOM, $item->changed) ."</updated>\n";
     $last_mod = $item->changed;
     $output .= "    <author>\n";
     if ($item->name) {
@@ -300,7 +305,7 @@ function theme_atom_feed($feed_info, $la
   $feed .= '  <link rel="alternate" type="text/html" href="'. $feed_info['html_url'] .'"/>'."\n";
   $feed .= '  <link rel="self" type="application/atom+xml" href="'. $feed_info['atom_url'] .'"/>'."\n";
   $feed .= '  <id>'. $feed_info['atom_url'] ."</id>\n";
-  $feed .= '  <updated>'. _atom_timestamp2w3dtf($last_mod) ."</updated>\n";
+  $feed .= '  <updated>'. gmdate(DATE_ATOM, $last_mod) ."</updated>\n";
   $feed .= $output;
   $feed .= "</feed>\n";
 
@@ -308,14 +313,6 @@ function theme_atom_feed($feed_info, $la
 }
 
 /**
- * @return string
- */
-function _atom_timestamp2w3dtf($timestamp) {
-  $tz = date("O", $timestamp);
-  return date("Y-m-d", $timestamp) .'T'. date("H:i:s", $timestamp) . substr($tz, 0, 3) .':'. substr($tz, 3, 2);
-}
-
-/**
  * Module configuration settings
  *
  * @return array of settings form options or deny access
