Date time parsing issue
Currently, the UTC date time in a GPX file is not parsed with UTC time zone.
A suggestion is to use the python-dateutil and replace the current parsing approach with dateutil.parser.
import dateutil.parser
def datetime_iso(string): """Parse an ISO formatted string. E.g: 2006-01-08T06:45:07Z Modified by W. K. Lo 2016-06-09
Return a datetime object.
"""
dt = dateutil.parser.parse(string)
return dt
Hope this fit with other parts well!
Regards, wklogoo
Sorry, I am new to GitHub. Not familiar with the formatting effect (and the preview button) of the text in the post.
This is a really nice piece of gpx module for python!
== repost for easy viewing ==
Currently, the UTC date time in a GPX file is not parsed with UTC time zone.
A suggestion is to use the python-dateutil and replace the current parsing approach with dateutil.parser.
import dateutil.parser
def datetime_iso(string):
"""Parse an ISO formatted string. E.g:
2006-01-08T06:45:07Z
Modified by W. K. Lo 2016-06-09
Return a datetime object.
"""
dt = dateutil.parser.parse(string)
return dt
Hope this fit with other parts well!
Regards, wklogoo
@wklogoo
Thanks for the suggestion.
Can you create a PR? If you need help on how to do that let me know.
Thanks
What is a PR? Please suggest some online materials for reference on the operation process of GitHub. Thx.
On Tue, Aug 9, 2016 at 1:25 AM, Nick Lang [email protected] wrote:
@wklogoo https://github.com/wklogoo
Thanks for the suggestion.
Can you create a PR? If you need help on how to do that let me know.
Thanks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fxdgear/pygpx/issues/5#issuecomment-238308058, or mute the thread https://github.com/notifications/unsubscribe-auth/AS663z9reJQK9_rt1bkm0ZnldYEMEEwoks5qd2ZugaJpZM4IyDIS .
Regards, W. K. Lo
PR = pull request.
You can fork this repo under your namespace. Create the change you want. Commit it to your repo.
Then you can create a PR from you're fork onto my repo.
Then I can review and submit feedback/accept it.
And merge your change set in to this Repo.
@wklogoo https://www.thinkful.com/learn/github-pull-request-tutorial/ might help!