X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fdate.php;h=d50aa872d0a772a290d2448823deb7e5e42c7b07;hb=c2c0a41046fc903cbca8b2482cc93ff52c2fa041;hp=55502c2ef33d816f7238d9c33ec61a4bf7e5f703;hpb=4f51df662e39f6a118606364441ae9964006b032;p=squirrelmail.git diff --git a/functions/date.php b/functions/date.php index 55502c2e..d50aa872 100644 --- a/functions/date.php +++ b/functions/date.php @@ -3,21 +3,22 @@ /** * date.php * - * Copyright (c) 1999-2005 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 * date SHOULD arrive in is: * 29 Jun 1999 09:52:11 -0500 (EDT) * (as specified in RFC 822) -- 'Tue' is optional * + * @copyright © 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. @@ -68,6 +69,8 @@ function getGMTSeconds($stamp, $tzc) { case 'IST': case 'MET DST': case 'METDST': + case 'MEST': + case 'CEST': $tzc = '+0200'; break; case 'HKT': @@ -302,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 ) { @@ -444,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