diff options
author | alecpl <alec@alec.pl> | 2012-01-06 10:43:05 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2012-01-06 10:43:05 +0000 |
commit | 529bd3f1c49be04c5eba851db2621b5b94940a89 (patch) | |
tree | 80c80d8ba15b89fd834d9b914e573c79baf4b549 /program/include/main.inc | |
parent | 87986cfdb99e3fe67e9711611361f034e27311b3 (diff) |
- Don't return 'unknown', use empty string, DateTime* handle more exceptions
Diffstat (limited to 'program/include/main.inc')
-rw-r--r-- | program/include/main.inc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index b0736625a..f6e2ca206 100644 --- a/program/include/main.inc +++ b/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'); } |