📜  在 python 代码示例中获取系统启动时间

📅  最后修改于: 2022-03-11 14:46:40.639000             🧑  作者: Mango

代码示例1
psutil. boot_time() returns the system boot time expressed in seconds since the epoch. It is the number of seconds that have elapsed since the Unix epoch, minus leap seconds; the Unix epoch is 00:00:00 UTC on 1 January 1970. To convert this time to DateTime we use fromtimestamp(), which returns the local date and time