From a5179f5d3eaf152d7d3b636047df8e058ef1c1a9 Mon Sep 17 00:00:00 2001 From: Andy Street Date: Sun, 15 Sep 2019 23:09:57 +0100 Subject: [PATCH] Bugfix: Timestamps not converted to UTC when writing GPX --- src/libgpx/gpxwriter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libgpx/gpxwriter.php b/src/libgpx/gpxwriter.php index 24b80b5..410bbe3 100644 --- a/src/libgpx/gpxwriter.php +++ b/src/libgpx/gpxwriter.php @@ -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); -- 2.39.5