We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With the current version of parsedatetime,
import parsedatetime as pdt import time cal = pdt.Calendar() def parsed_time(time_str): # Just prints the parsed time back return time.strftime('%Y-%m-%d %H:%M', cal.parse(time_str)[0]) times = ['Aug 05, 2014 4:15 AM', 'Aug 05, 2003 3:15 AM', 'Aug 05, 2003 03:15 AM'] for t in times: print '{}\t{}'.format(t, parsed_time(t))
returns
Aug 05, 2014 4:15 AM 2016-08-05 04:15 Aug 05, 2003 3:15 AM 2016-08-05 03:15 Aug 05, 2003 03:15 AM 2020-08-05 03:15
PS:- I guess the bug is in function _partialParseDateStr where there has to be an additional check if the matched time is indeed inside parseStr
_partialParseDateStr
parseStr
say changing
if fTime:
to
if fTime and len(parseStr) > mm.start('hours'):
seems to be working for me.
The text was updated successfully, but these errors were encountered:
bug(date3): rely on comparison of hour and year strings
e528d27
but not strict char position Which cause certain strings with format like "MM DD, YYxx xx:SS" parsed incorrectly. See detail: bear#137
bug(date3): rely on comparison of hour and year strings but not stric…
73b4542
…t char position Which cause certain strings with format like "MM DD, YYxx xx:SS" parsed incorrectly. See bear#137
@codereverser Please check if this bug has been fixed.
Sorry, something went wrong.
Looks all good now. Many thanks! 👍
No branches or pull requests
With the current version of parsedatetime,
returns
PS:- I guess the bug is in function
_partialParseDateStr
where there has to be an additional check if the matched time is indeed insideparseStr
say changing
to
seems to be working for me.
The text was updated successfully, but these errors were encountered: