summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-01-06 10:43:05 +0000
committeralecpl <alec@alec.pl>2012-01-06 10:43:05 +0000
commit529bd3f1c49be04c5eba851db2621b5b94940a89 (patch)
tree80c80d8ba15b89fd834d9b914e573c79baf4b549 /program
parent87986cfdb99e3fe67e9711611361f034e27311b3 (diff)
- Don't return 'unknown', use empty string, DateTime* handle more exceptions
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc11
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');
}