vstinner / hachoir

Hachoir is a Python library to view and edit a binary stream field by field
http://hachoir.readthedocs.io/
GNU General Public License v2.0
604 stars 70 forks source link

Default date info for TimeDateMSDOS32 #69

Closed cccs-rs closed 3 years ago

cccs-rs commented 3 years ago

Datetime can't be created with 0 value for day and/or month. This should cause the value to default to 1 if the value is 0.

vstinner commented 3 years ago

I understand that without this change, it was not possible to display some binary files which were seen as "invalid" by Hachoir, and this change makes it possible. So I merged it. An alternative would be to modify the code to render the timestamp as it is stored, like 1980-0-0 rather than 1980-1-1.