diff options
author | zed <isidore.john.r@gmail.com> | 2020-11-15 17:09:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 15:09:31 +0100 |
commit | 21bb0822c7d30adc1e144e87d730cd67eb4fa828 (patch) | |
tree | 23f1da560b0f6904525ea002825e5712be363970 /README.rst | |
parent | 8fc5ed1b20c9c9fab75164aae1984698a46974dc (diff) | |
download | psutil-21bb0822c7d30adc1e144e87d730cd67eb4fa828.tar.gz |
remove misleading "in UTC" (#1882)
"seconds since the epoch" (value returned by `time.time()`) doesn't
depend on the local time zone. It is the same time instance around the
world. It is not in any particular time zone:
```python
import datetime as DT
import zoneinfo
local_time = DT.datetime.fromtimestamp(seconds_since_epoch) # naive datetime object representing local time
utc_time = DT.datetime.utcfromtimestamp(seconds_since_epoch) # naive datetime object representing utc time
la_time = DT.datetime.fromtimestamp(seconds_since_epoch, zoneinfo.ZoneInfo("America/Los_Angeles")) # timezone aware dt
```
Here `local_time`, `utc_time`, `la_time` may correspond to different
clock times but it is exactly the same time instance.
Diffstat (limited to 'README.rst')
0 files changed, 0 insertions, 0 deletions