diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-06 10:43:05 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-01-06 10:43:05 +0000 |
| commit | efbd7fdce36f3ecbc53623eeff93b7998fcc7528 (patch) | |
| tree | 29245bbad9bec637d445530bb40c206255ecee4a /roundcubemail/program/include/main.inc | |
| parent | 66ee29eb5f1941d0fc10dd5092c7abf0c6b15301 (diff) | |
- Don't return 'unknown', use empty string, DateTime* handle more exceptions
git-svn-id: https://svn.roundcube.net/trunk@5732 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/main.inc')
| -rw-r--r-- | roundcubemail/program/include/main.inc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc index b0736625a..f6e2ca206 100644 --- a/roundcubemail/program/include/main.inc +++ b/roundcubemail/program/include/main.inc @@ -1066,7 +1066,7 @@ function format_date($date, $format=NULL, $convert=true) $date = new DateTime("@".$ts); } catch (Exception $e) { - return 'unknown'; + return ''; } try { @@ -1886,9 +1886,14 @@ function rcmail_user_date() global $RCMAIL; // get user's timezone - $tz = new DateTimeZone($RCMAIL->config->get('timezone')); + try { + $tz = new DateTimeZone($RCMAIL->config->get('timezone')); + $date = new DateTime('now', $tz); + } + catch (Exception $e) { + $date = new DateTime(); + } - $date = new DateTime('now', $tz); return $date->format('r'); } |
