]> git.street.me.uk Git - andy/gpx.git/commitdiff
Bugfix: Timestamps not converted to UTC when writing GPX master
authorAndy Street <andy@street.me.uk>
Sun, 15 Sep 2019 22:09:57 +0000 (23:09 +0100)
committerAndy Street <andy@street.me.uk>
Sun, 15 Sep 2019 22:09:57 +0000 (23:09 +0100)
src/libgpx/gpxwriter.php

index 24b80b5ab8ec9771a42b6a736c59bed6eb4963f3..410bbe35784dcbff78b522bcc904f579300c5d18 100644 (file)
@@ -425,7 +425,7 @@ class GPXWriter
   ) {
     if ($millis === null)
       $millis = $this->milliseconds;
-    if (!$timestamp->getTimezone()->getOffset($timestamp))
+    if ($timestamp->getTimezone()->getOffset($timestamp) != 0)
       $timestamp = $timestamp->setTimezone(new DateTimeZone('UTC'));
     $format = 'Y-m-d\TH:i:s' . ($millis ? '.v\Z' : '\Z');
     return $timestamp->format($format);