Add functions to help diagnose if plugin dependencies are in place
[squirrelmail.git] / functions / date.php
index e40cf7c6f221fcf66748c2ea8eddc0881f7229e8..d50aa872d0a772a290d2448823deb7e5e42c7b07 100644 (file)
@@ -8,15 +8,17 @@
  *       <Tue,> 29 Jun 1999 09:52:11 -0500 (EDT)
  * (as specified in RFC 822) -- 'Tue' is optional
  *
- * @copyright &copy; 1999-2005 The SquirrelMail Project Team
+ * @copyright &copy; 1999-2007 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
  * @subpackage date
  */
 
-/** Load up some useful constants */
-require_once(SM_PATH . 'functions/constants.php');
+/**
+ * dependency information
+ * - none
+ */
 
 /**
  * Corrects a time stamp to be the local time.
@@ -67,6 +69,8 @@ function getGMTSeconds($stamp, $tzc) {
         case 'IST':
         case 'MET DST':
         case 'METDST':
+       case 'MEST':
+       case 'CEST':
             $tzc = '+0200';
             break;
         case 'HKT':
@@ -301,14 +305,15 @@ function date_intl( $date_format, $stamp ) {
  * and taking localization into accout.
  *
  * @param int stamp the timestamp
+ * @param string fallback string to use when stamp not valid
  * @return string the long date string
  */
-function getLongDateString( $stamp ) {
+function getLongDateString( $stamp, $fallback = '' ) {
 
     global $hour_format;
 
     if ($stamp == -1) {
-        return '';
+        return $fallback;
     }
 
     if ( $hour_format == SMPREF_TIME_12HR ) {
@@ -443,15 +448,3 @@ function getTimeStamp($dateParts) {
         return getGMTSeconds($stamp, $dateParts[0]);
     }
 }
-
-/* I use this function for profiling. Should never be called in
-   actual versions of SquirrelMail released to public. */
-/*
-   function getmicrotime() {
-      $mtime = microtime();
-      $mtime = explode(' ',$mtime);
-      $mtime = $mtime[1] + $mtime[0];
-      return ($mtime);
-   }
-*/
-?>
\ No newline at end of file