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.


Off road mapping via OS RouteMapper and the Health Graph

Mark Kelsey (@freddy4th) is a doctor and a programmer with some great ideas for using the Health Graph (@healthgraphapi). This week we feature him and his first published Health Graph app, OS RouteMapper (@osroutemapper), in our ongoing series on Health Graph partners.

Bill Day: Please tell us about yourself and your company.

Mark Kelsey: I am a doctor by profession and an amateur self taught programmer. I have developed a number of web applications and software packages which we use within my medical practice and I now also work for a software company which develops clinical decision support software. Work on my Health Graph app OS RouteMapper is therefore a bit of a sideline at the moment, though with my medical background I have lots of ideas for how the Health Graph API could be used to help people manage their medical conditions.

BD: What’s the “elevator pitch” for why someone should use your app?

MK: OS RouteMapper allows people to view their Runkeeper activities on Ordnance Survey maps within the UK. These maps are world renowned for being very detailed and in particular provide excellent detail off road. They are therefore particularly useful for walkers, cyclists or runners who don’t stick to roads! Outside the UK, the app uses OpenStreetMaps Cycle Maps which in many areas are much more detailed than Google maps, again particularly useful off road.

BD: How did you get started using the Health Graph API?

MK: After using Runkeeper to track my cycling activities, I wanted to view my activities on more detailed maps so I could see where I’d been (I’m often cycling at night along dark tracks!) and plan where else to ride.

Before the Health Graph API was released, I developed a web site that would allow me to upload GPX files to show on an OS Map. When the Health Graph API was released it was a natural development to automatically get the activities off Runkeeper. I was surprised by how many people started using the app when I published it and when I saw that people from other countries were using it I added the support for OpenStreetMaps Cycle Maps. After seeing how easy it was to integrate with the Health Graph API, I have thought of lots of other ideas about how the data could be used in different ways.

BD: How has using the Health Graph benefited you?

MK: At the moment this is just a sideline for me but I think some of the ideas I have may have even greater appeal to lots of people and may become a commercial opportunity.

BD: Which portions of the Health Graph API do you use, and why?

MK: I mainly use the activities feed and in particular the path of each activity is used to plot the route on the map. The street team feed is also used to enable users to view street team members’ activities on the maps.

BD: What do you like about the Health Graph? What would you like to see changed?

MK: It is very easy to integrate with the Health Graph and the documentation is very clear, even for an amateur programmer like me! One addition I would appreciate is the ability to view the user’s saved routes as this is currently not available. I would also like to develop the ability for users to plan routes using my maps and save them back to the Runkeeper / HealthGraph site as a route.

BD: If you could request any crazy new feature from the Health Graph, what would it be? How would you use it?

MK: With my background as a doctor, I would really love to see some integration with clinical systems and devices so that users can see data (e.g. blood glucose measurements, BP readings, Weight readings etc.) that their doctor has on the clinical system, and they can see the effect of their exercise on their medical conditions. This could extend to things like blood glucose monitors so patients can automatically upload data. I think this kind of thing could really help telemedicine develop in the future.

BD: Can you share any future plans for your app? What’s coming next that your users will be excited about? Does the Health Graph play a role in that, and if so, how?

MK: In the immediate future, I am developing a way for users to compare their performance over parts of their routes i.e. split times, so that even if they don’t follow exactly the same route twice, they can compare their performance over the parts of the route that are the same. As stated above I have a number of other ideas that I think would work well with the Health Graph and build on it. I am hoping to develop these.

BD: Is there anything else we should know about you or your application?

MK: You can follow future developments on Twitter at @osroutemapper!

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


Follow

Get every new post delivered to your Inbox.

Join 1,334 other followers