make getLongReadableDate() behave like getReadableDate()

This commit is contained in:
Uwe Steinmann 2022-05-02 11:45:32 +02:00
parent 52fbe0128f
commit e67dce277e

View File

@ -66,11 +66,22 @@ function getReadableDate($timestamp=0) { /* {{{ */
return date("Y-m-d", $timestamp); return date("Y-m-d", $timestamp);
} /* }}} */ } /* }}} */
function getLongReadableDate($timestamp) { /* {{{ */ /**
* Return a human readable date and time string
*
* See note for getReadableDate()
*/
function getLongReadableDate($timestamp=0) { /* {{{ */
global $settings; global $settings;
if(!is_numeric($timestamp)) if($timestamp === 0)
$timestamp = time();
elseif($timestamp && is_numeric($timestamp))
;
elseif($timestamp && is_string($timestamp))
$timestamp = strtotime($timestamp); $timestamp = strtotime($timestamp);
if($settings->_datetimeformat) elseif(!is_numeric($timestamp))
return '';
if($settings->_dateformat)
return date($settings->_datetimeformat, $timestamp); return date($settings->_datetimeformat, $timestamp);
else else
return date("Y-m-d H:i:s", $timestamp); return date("Y-m-d H:i:s", $timestamp);