Changeset 1924:f4b90fa97634


Ignore:
Timestamp:
Apr 10, 2020, 8:25:01 PM (16 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
histedit_source:
ea6479673cab0088f3cb9420da5558e53f875a9f
Message:
Update `set_time_shift` docstring

Emphasize that the client time is UTC. This is consistent with the
new calculation in `_Stat.parse_unix_time`.

In previous versions of ftputil, the time shift was supposed to be the
difference between the local server time (assumed from the timestamp
on the server) and the local client time. However, in some
circumstances the client time was retrieved in UTC (namely by
`os.path.getmtime`), which was inconsistent with other places where
the client time was assumed to be a local time.

ticket: 134
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ftputil/host.py

    r1899 r1924  
    310310        """
    311311        Set the time shift value (i. e. the time difference between
    312         client and server) for this `FTPHost` object. By (my)
    313         definition, the time shift value is positive if the local
    314         time of the server is greater than the local time of the
    315         client (for the same physical time), i. e.
    316 
    317             time_shift =def= t_server - t_client
    318         <=> t_server = t_client + time_shift
    319         <=> t_client = t_server - time_shift
     312        client and server, where the client time is in UTC) for this
     313        `FTPHost` object. By (my) definition, the time shift value is
     314        positive if the local time of the server is greater than the
     315        local time of the client (for the same physical time), i. e.
     316
     317            time_shift =def= t_server - t_client_utc
     318        <=> t_server = t_client_utc + time_shift
     319        <=> t_client_utc = t_server - time_shift
    320320
    321321        The time shift is measured in seconds.
Note: See TracChangeset for help on using the changeset viewer.