summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2013-10-22 07:51:28 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2013-10-22 07:55:28 (GMT)
commit7d39e6bdff1251f0e346fd2aef36f46ceb3356de (patch)
tree19bedeff3a53e6114e6623bee9744d54e87d7882
parentb275e023f2828048eda2036c48506c96a687be4d (diff)
downloadroundcubemail-plugins-kolab-7d39e6bdff1251f0e346fd2aef36f46ceb3356de.tar.gz
Fix saving created/changed dates: always use UTC timezone
-rw-r--r--plugins/libkolab/lib/kolab_format.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php
index 5bcc57a..aa88f69 100644
--- a/plugins/libkolab/lib/kolab_format.php
+++ b/plugins/libkolab/lib/kolab_format.php
@@ -401,13 +401,13 @@ abstract class kolab_format
// set some automatic values if missing
if (empty($object['created']) && method_exists($this->obj, 'setCreated')) {
$cdt = $this->obj->created();
- $object['created'] = $cdt && $cdt->isValid() ? self::php_datetime($cdt) : new DateTime('now', self::$timezone);
+ $object['created'] = $cdt && $cdt->isValid() ? self::php_datetime($cdt) : new DateTime('now', new DateTimeZone('UTC'));
if (!$cdt || !$cdt->isValid())
$this->obj->setCreated(self::get_datetime($object['created']));
}
- $object['changed'] = new DateTime('now', self::$timezone);
- $this->obj->setLastModified(self::get_datetime($object['changed'], new DateTimeZone('UTC')));
+ $object['changed'] = new DateTime('now', new DateTimeZone('UTC'));
+ $this->obj->setLastModified(self::get_datetime($object['changed']));
// Save custom properties of the given object
if (isset($object['x-custom'])) {