Bug #23056 ยป 14945-befunc-time-timeage.patch
t3lib/class.t3lib_befunc.php (working copy) | ||
---|---|---|
}
|
||
/**
|
||
* Returns $tstamp formatted as "hhmm" (According to $TYPO3_CONF_VARS['SYS']['hhmm'])
|
||
* Usage: 11
|
||
*
|
||
* @param integer Time stamp, seconds
|
||
* @return string Formatted time
|
||
*/
|
||
public static function time($tstamp) {
|
||
return date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'], (int)$tstamp);
|
||
}
|
||
/**
|
||
* Returns $tstamp formatted as "ddmmyy hhmm" (According to $TYPO3_CONF_VARS['SYS']['ddmmyy'] AND $TYPO3_CONF_VARS['SYS']['hhmm'])
|
||
* Usage: 28
|
||
*
|
||
... | ... | |
* @param boolean Output hh:mm:ss. If false: hh:mm
|
||
* @return string Formatted time
|
||
*/
|
||
public static function time($value, $withSeconds = TRUE) {
|
||
public static function timeAge($value, $withSeconds = TRUE) {
|
||
$hh = floor($value/3600);
|
||
$min = floor(($value-$hh*3600)/60);
|
||
$sec = $value-$hh*3600-$min*60;
|
||
... | ... | |
self::calcAge(abs($GLOBALS['EXEC_TIME'] - $value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')) .
|
||
')';
|
||
} elseif (t3lib_div::inList($theColConf['eval'], 'time')) {
|
||
$l = self::time($value, FALSE);
|
||
$l = self::timeAge($value, FALSE);
|
||
} elseif (t3lib_div::inList($theColConf['eval'], 'timesec')) {
|
||
$l = self::time($value);
|
||
$l = self::timeAge($value);
|
||
} elseif (t3lib_div::inList($theColConf['eval'], 'datetime')) {
|
||
$l = self::datetime($value);
|
||
} else {
|