Skip to content
New issue

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

Update file_cnab240_parser.py #42

Open
wants to merge 1 commit into
base: 10.0
Choose a base branch
from
Open

Conversation

yk2kus
Copy link

@yk2kus yk2kus commented Feb 1, 2017

Use .zfill(8) on date, because it ignores the leading zeros hence gets wrong date, becasue in library dates are read as numbers , "formato": "num"
Eg:

date='3012017'
datetime.datetime.strptime(date,'%d%m%Y').date()
datetime.date(2017, 1, 30)
date='03012017'
datetime.datetime.strptime(date,'%d%m%Y').date()
datetime.date(2017, 1, 3)

Use .zfill(8) on date, because it ignores the leading zeros hence gets wrong date.
Eg:

>>> date='3012017'
>>> datetime.datetime.strptime(date,'%d%m%Y').date()
datetime.date(2017, 1, 30)
>>> date='03012017'
>>> datetime.datetime.strptime(date,'%d%m%Y').date()
datetime.date(2017, 1, 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant