mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-05 21:49:28 +01:00
use show_date as implemented in trunk; as the old stuff is outdated and should not be used anymore
This commit is contained in:
parent
718b70526d
commit
8406dfca06
@ -1149,33 +1149,16 @@ class common
|
||||
* @param int $t=0 timestamp, default current time
|
||||
* @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
|
||||
* @deprecated use egw_time::to($time, $format) egw_time::server2user($time, $format)
|
||||
* @return string the formated date/time
|
||||
*/
|
||||
static function show_date($t = 0, $format = '', $adjust_to_usertime=true)
|
||||
{
|
||||
if (!$t)
|
||||
{
|
||||
$t = $GLOBALS['egw']->datetime->gmtnow;
|
||||
}
|
||||
if (!$t) $t = 'now';
|
||||
|
||||
if ($adjust_to_usertime)
|
||||
{
|
||||
$t += $GLOBALS['egw']->datetime->tz_offset;
|
||||
}
|
||||
|
||||
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);
|
||||
$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));
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user