EducationalTestingService / gitlab-to-atlassian

Scripts to help export information from GitLab to Atlassian JIRA and Stash.
Other
36 stars 11 forks source link

Use dateutil and naive datetimes for date filtering #10

Closed yekibud closed 8 years ago

yekibud commented 8 years ago

Not sure how GitLab writes its date strings, but I think it may vary based on installation and server configuration. The previous hard-coded format string failed for me with:

ValueError: time data '2016-04-21T15:09:38.552-07:00' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

I don't know of a good native fix for this, as strptime does not seem to support the above style of timezone off-set formatting, so I think it may be worth adding the trusty python-dateutil package to the dependencies for all-purpose date string parsing.

I'm also not sure how this script ever worked since the default date filter is naive and the format string is timezone aware. So I stripped tzinfo from the GL time data, since the expected date_filter parameter is YYYY-MM-DD anyway.

Sound good?

dan-blanchard commented 8 years ago

Thanks for the PR!