tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
987 stars 223 forks source link

reading in gpx waypoint with time element returns class datetime.datetime? #12

Closed seanth closed 11 years ago

seanth commented 11 years ago

Reading in a gpx file with waypoints that have time elements, the time element is returned in the format:

datetime.datetime(2011, 9, 2, 19, 6, 34)

Is that a feature or a bug?

tkrajina commented 11 years ago

"datetime.datetime(2011, 9, 2, 19, 6, 34)" is just a string representation of the standard python object containing time information. This is what gpxpy uses internally. If you need the standard GPX string representation, use:

waypoint.time.strftime(gpxpy.gpx.DATE_FORMAT)