6e8894d5ff
The ModifiedTime and ModifiedDate fields are not expressive enough for many of the time extensions that have since been added to ZIP, nor are they easy to access since they in a legacy MS-DOS format, and must be set and retrieved via the SetModTime and ModTime methods. Instead, we add new field Modified of time.Time type that contains all of the previous information and more. Support for extended timestamps have been attempted before, but the change was reverted because it provided no ability for the user to specify the timezone of the legacy MS-DOS fields. Technically the old API did not either, but users were manually offsetting the timestamp to achieve the same effect. The Writer now writes the legacy timestamps according to the timezone of the FileHeader.Modified field. When the Modified field is set via the SetModTime method, it is in UTC, which preserves the old behavior. The Reader attempts to determine the timezone if both the legacy and extended timestamps are present since it can compute the delta between the two values. Since Modified is a superset of the information in ModifiedTime and ModifiedDate, we mark ModifiedTime, ModifiedDate, ModTime, and SetModTime as deprecated. Fixes #18359 Change-Id: I29c6bc0a62908095d02740df3e6902f50d3152f1 Reviewed-on: https://go-review.googlesource.com/74970 Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Contributing
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that we use the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.