Convert GPX normalized time to local time

We sometimes get questions about how to figure out the local time for fitness activities exported as part of a user data export.

Time and date information included in exported GPX files are normalized to universal time. See below for an example showing normalized times such as 2012-03-24T06:12:45Z.

Here are the steps you would follow to convert from universal time to local time:

  1. Read the normalized date and time out of one or more GPX export file track points
  2. Use the latitude and longitude in those track points to derive local time zone offset(s)
  3. Convert the universal time values in the GPX files into local time using the offset(s)

That’s all there is to it!

Bill Day (@billday) is Platform Evangelist for RunKeeper where he helps developers learn about and use the Health Graph.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 1,335 other followers