hozn/stravalib — pull request #31 by jsamoocha (2014-11-09 16:54:02+00:00)
Title: Timezone fix

I ran into some timezone-related issues when using get_activities() with the "before" and "after" args. According to the docs, this function assumes the "before" and "after" args to be in the UTC timezone. However, these datetime objects where converted to epoch using [time.mktime()](https://docs.python.org/2/library/time.html#time.mktime), which assumes the time to be local.

I fixed this by extracting the datetime-epoch conversion routine and by using [calendar.timegm()](https://docs.python.org/2/library/calendar.html#calendar.timegm), as suggested [here](http://stackoverflow.com/questions/2956886/python-calendar-timegm-vs-time-mktime).

I created an isolated test for demonstrating the issue (and correctness of fix) to avoid having to get a Strava access token for running the whole test suite.