Open thernstig opened 6 years ago
It can if you write it Fri Jan 26 16:32:21 2018 +0000
or 'Fri Jan 26 16:32:21 2018 +0000
- seems weird to not have the TZ offset at the end.
@alertedsnake I agree completely, and more people do. But this is Twitter's way to format it. See created_at
at this page: https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/tweet-object.html
@thernstig wow, how bizarre!
This should work with date_formats
once we merge this: https://github.com/scrapinghub/dateparser/pull/840/files
>>> dateparser.parse('Fri Jan 26 16:32:21 +0000 2018', date_formats=['%a %b %d %H:%M:%S %z %Y'])
datetime.datetime(2018, 1, 26, 16, 32, 21, tzinfo=datetime.timezone.utc)
@noviluni That is a good approach, that is the approach many time libraries take to let you specify the format. In addition, it seems Twitters API v2 will have a better created_at
from the start.
Dateparser is unable to parse this string: Fri Jan 26 16:32:21 +0000 2018