[Zlib-devel] DosDate and Year 1980

Baird, David david.baird at agresearch.co.nz
Mon Jan 8 16:52:23 EST 2007


Hi,

The zip packages produced by Office 2007 use a Dos Date of 1/1/1980 (=0)
for all the parts of the zip file -lazy programmers, you would expect
better from MS.
When processing these dates to a new zip file, the current 
ziplocal_TmzDateToDosDate(const tm_zip* ptm, uLong dosDate) function
produces a year of 2088 for 1980, as it does not subtract 1980 from the
year
1980. To fix this, I changed the code in zip.c for
ziplocal_TmzDateToDosDate
from:
    if (year>1980)
        year-=1980;
    else if (year>80)
        year-=80;
to:
    if (year>=1980)
        year-=1980;
    else if (year>=80)
        year-=80;

Regards,
David
_________________________________________________________
Dr David Baird, Biometrician  EMail:  David.Baird at AgResearch.CO.NZ
Mail: AgResearch, PO Box 60, Gerald St, Lincoln, NEW ZEALAND
Phone: +64 3 325 9975   Fax: +64 3 325 9946
=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================




More information about the Zlib-devel mailing list