Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Doc/library/tarfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,12 @@ be finalized; only the internally used file object will be closed. See the
:const:`None` the :class:`TarInfo` object will be excluded from the
archive. See :ref:`tar-examples` for an example.

The file's last modification time is stored in the archive member's
:attr:`~TarInfo.mtime` as seconds since the epoch, without conversion to
local time. Changing the process's time zone therefore does not itself
change the stored member timestamp, although the result can still vary if
the filesystem reports time-zone-dependent timestamps.

.. versionchanged:: 3.2
Added the *filter* parameter.

Expand Down
8 changes: 8 additions & 0 deletions Doc/library/zipfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,14 @@ ZipFile objects
given.
The archive must be open with mode ``'w'``, ``'x'`` or ``'a'``.

The file's last modification time is converted to the current local time
and stored in the archive member's :attr:`~ZipInfo.date_time`. Since ZIP
timestamps do not record a time zone, creating an archive from the same
file in different time zones can result in different stored timestamps.
To control the timestamp, create a :class:`ZipInfo` with an explicit
:attr:`~ZipInfo.date_time` and pass it with the file contents to
:meth:`writestr`.

.. note::

The ZIP file standard historically did not specify a metadata encoding,
Expand Down
Loading