diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-07-31 14:29:08 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-07-31 14:29:14 +0200 |
commit | cc850263d40ac080890f2b9f7bb797f83e7a30ff (patch) | |
tree | 77706c5c02d58cc03c95625b7a60ed8b31de2374 | |
parent | a6e9b4f97bfd60bb58dd06dc48c629541149c377 (diff) |
Add optional timezone argument for date conversion
-rw-r--r-- | program/lib/Roundcube/rcube_utils.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_utils.php b/program/lib/Roundcube/rcube_utils.php index 00999ba50..39e27fc7f 100644 --- a/program/lib/Roundcube/rcube_utils.php +++ b/program/lib/Roundcube/rcube_utils.php @@ -795,7 +795,7 @@ class rcube_utils * * @return object DateTime instance or false on failure */ - public static function anytodatetime($date) + public static function anytodatetime($date, $timezone = null) { if (is_object($date) && is_a($date, 'DateTime')) { return $date; @@ -807,7 +807,7 @@ class rcube_utils // try to parse string with DateTime first if (!empty($date)) { try { - $dt = new DateTime($date); + $dt = new DateTime($date, $timezone); } catch (Exception $e) { // ignore |