use show_date as implemented in trunk; as the old stuff is outdated and should not be used anymore

This commit is contained in:
Klaus Leithoff 2014-03-24 15:15:46 +00:00
parent 718b70526d
commit 8406dfca06

View File

@ -1149,33 +1149,16 @@ class common
* @param int $t=0 timestamp, default current time * @param int $t=0 timestamp, default current time
* @param string $format='' timeformat, default '' = read from the user prefernces * @param string $format='' timeformat, default '' = read from the user prefernces
* @param boolean $adjust_to_usertime=true should datetime::tz_offset be added to $t or not, default true * @param boolean $adjust_to_usertime=true should datetime::tz_offset be added to $t or not, default true
* @deprecated use egw_time::to($time, $format) egw_time::server2user($time, $format)
* @return string the formated date/time * @return string the formated date/time
*/ */
static function show_date($t = 0, $format = '', $adjust_to_usertime=true) static function show_date($t = 0, $format = '', $adjust_to_usertime=true)
{ {
if (!$t) if (!$t) $t = 'now';
{
$t = $GLOBALS['egw']->datetime->gmtnow;
}
if ($adjust_to_usertime) $ret = $adjust_to_usertime ? egw_time::server2user($t, $format) : egw_time::to($t, $format);
{ //error_log(__METHOD__.'('.array2string($t).", '$format', ".array2string($adjust_to_usertime).') returning '.array2string($ret));
$t += $GLOBALS['egw']->datetime->tz_offset; return $ret;
}
if (!$format)
{
$format = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat'] . ' - ';
if ($GLOBALS['egw_info']['user']['preferences']['common']['timeformat'] == '12')
{
$format .= 'h:i a';
}
else
{
$format .= 'H:i';
}
}
return adodb_date($format,$t);
} }
/** /**