• Joe Tsai's avatar
    archive/zip: preserve old FileHeader.ModTime behavior · d85a3535
    Joe Tsai authored
    In order to avoid a regression where the date of the ModTime method
    changed behavior, simply preserve the old behavior of determining
    the date based on the legacy fields.
    
    This ensures that anyone relying on ModTime before Go1.10 will have
    the exact same behavior as before.
    New users should use FileHeader.Modified instead.
    
    We keep the UTC coersion logic in SetModTime since some users
    manually compute timezone offsets in order to have precise control
    over the MS-DOS time field.
    
    Fixes #22738
    
    Change-Id: Ib18b6ebd863bcf645748e083357dce9bc788cdba
    Reviewed-on: https://go-review.googlesource.com/78031Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    Run-TryBot: Russ Cox <rsc@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    d85a3535
writer.go 14.9 KB