this is a fix for the LSUB with a % when getting the folder list. This makes the...
[squirrelmail.git] / functions / date.php
index 7276811aea3bede464e2fd9c752125f8c9c0cd70..a65308d6546fd0cbf5851e45c42da8168e513c43 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * date.php
  *
- * Copyright (c) 1999-2001 The SquirrelMail Development Team
+ * Copyright (c) 1999-2002 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Takes a date and parses it into a usable format.  The form that a
@@ -58,9 +58,10 @@ function getGMTSeconds($stamp, $gmt) {
     } else {
         $neg = false;
     }
-    
+     
+    $difference = substr($gmt, 2, 2);
     $gmt = substr($gmt, 0, 2);
-    $gmt = $gmt * 3600;
+    $gmt = ($gmt + ($difference / 60)) * 3600;
     if ($neg == true) {
         $gmt = "-$gmt";
     } else {
@@ -162,9 +163,13 @@ function date_intl( $date_format, $stamp ) {
 
     $ret = str_replace( 'D', '$1', $date_format );
     $ret = str_replace( 'F', '$2', $ret );
+    $ret = str_replace( 'l', '$4', $ret );
+    $ret = str_replace( 'M', '$5', $ret );
     $ret = date( '$3'. $ret . '$3', $stamp ); // Workaround for a PHP 4.0.4 problem
     $ret = str_replace( '$1', substr( getDayName( date( 'w', $stamp ) ), 0, 3 ), $ret );
+    $ret = str_replace( '$5', substr( getMonthName( date( 'm', $stamp ) ), 0, 3 ), $ret );    
     $ret = str_replace( '$2', getMonthName( date( 'm', $stamp ) ), $ret );
+    $ret = str_replace( '$4', getDayName( date( 'w', $stamp ) ), $ret );
     $ret = str_replace( '$3', '', $ret );
     
     return( $ret );