Thomas Bruederli
2014-07-31 cc850263d40ac080890f2b9f7bb797f83e7a30ff
Add optional timezone argument for date conversion
1 files modified
4 ■■■■ changed files
program/lib/Roundcube/rcube_utils.php 4 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_utils.php
@@ -795,7 +795,7 @@
     *
     * @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 @@
        // try to parse string with DateTime first
        if (!empty($date)) {
            try {
                $dt = new DateTime($date);
                $dt = new DateTime($date, $timezone);
            }
            catch (Exception $e) {
                // ignore