//Set whether lat or lon is positive or negative if ($row['NS'] == "S") { $lat = $lat * -1; } if ($row['EW'] == "W") { $lon = $lon * -1; } //Offset the UTC time to user's local time $dt = new DateTime($row['eventdate']); //$dt = $dt->add(new DateInterval("P".$timezone_offset."H")); //$dt = $dt->add(new DateInterval('PT4H')); $gps->addPoint($lat, $lon, $dt->format(DateTime::ISO8601)); } mysqli_close($con); try { $gps->CreateGPXFile(); } catch (Exception $e) { logger("Failed to export GPX file: CreateGPXFile() - " . $e->getMessage()); } logger("Generated GPX file for APIKey:" . $apikey); //Output HTML page w/ link to file ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Download page</title> </head> <body> <a href="<?php echo $outputdir . $file;