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 /docs | |
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 'docs')
-rw-r--r-- | docs/index.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/index.rst b/docs/index.rst index 46795150..a99ab206 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1180,7 +1180,7 @@ Process class .. method:: create_time() The process creation time as a floating point number expressed in seconds - since the epoch, in UTC. The return value is cached after first call. + since the epoch. The return value is cached after first call. >>> import psutil, datetime >>> p = psutil.Process() |