这些天来,我们的Windows笔记本电脑和 PC 持续运行很长时间。您还记得上次关闭 PC 是什么时候吗?如今,用户考虑让他们的计算机进入睡眠状态,以便更快地恢复。
现在您知道您的计算机每次关闭或启动计算机时都会记录时间戳吗?您的计算机运行的总持续时间称为Uptime。计算机关机的持续时间称为停机时间(Downtime)。
对于普通的日常用户来说,正常运行时间或停机时间数据可能并不重要。但是,如果您将计算机用作组织中的服务器,那么这些数字可能会很有趣。此外,如果您有兴趣监控您的计算机,这些数据可能会对您有所帮助。在这篇文章中,我们将讨论找出Windows 停机时间(Windows Downtime)、正常运行时间(Uptime)和上次关机时间的方法
找出 Windows 停机时间和正常运行时间
1]使用事件查看器
事件查看器是一个内置的Windows实用程序,可让您查看Windows记录的各种事件。正如我已经提到的,Windows 会记录上次关机和启动时间(Windows logs the last shutdown and start-up time),并且可以在事件查看器(Event Viewer)中找到。
请按照以下步骤了解您的 PC 上次“关机(Shut)”的时间。
- 转到开始并搜索“事件查看器(Event Viewer)”,然后按 Enter。
- 从左侧的“控制台树”展开“ Windows 日志(Windows Logs)”。并从中选择“系统”(System’)。
- 等待(Wait)所有事件加载。现在单击右侧“操作窗格”中的“过滤当前日志(Filter current log)”。
- 现在在显示“ <All Event IDs> ”的文本框中,将文本替换为“ 6005, 6006 ”。
- 刷新当前日志。
- (Sort)根据记录事件的时间和日期对列表进行排序。最新条目位于列表顶部。
现在,您已经对列表进行了过滤和排序,从而为您提供了所有必需的信息。列表中事件 ID 为 6006(Event ID 6006)的第一个条目为您提供计算机上次关闭(Shut Down)的时间。ID 为 6005(ID 6005)的第一个条目为您提供 PC 再次启动的时间。两个时间戳之间的差异为您提供了净停机时间 - 或计算机处于完全断电状态的持续时间。此外,您当前时间和上次启动时间之间的差异可以为您提供计算机的总正常运行时间。
Current Time - Last Start Time = Total Uptime
Last Start Time - Last Shut Down Time = Total Downtime
2]使用任务管理器
这种方法是计算正常运行时间(Uptime)的一种比较简单的方法,但它不计算停机时间(Downtime)。您需要做的就是打开“任务(All)管理器(Task Manager)”并转到“性能(Performance)”选项卡。从左侧菜单中选择“ CPU ”,现在在右侧部分中查找“正常运行时间”。
总正常运行时间将以 DD:HH:MM:SS 格式显示。如果您只是在寻找当前的正常运行时间,那么使用任务管理器就可以了。(Task Manager)它无法显示事件的全部历史记录,而在事件查看器(Event Viewer)中,您可以及时返回并查看较早的事件日志并相应地计算正常运行时间(Uptime)和停机时间(Downtime)。
3]使用CMD
查看Workstation服务的统计信息还可以为您提供上次启动时间。为此,请打开“CMD”并键入以下命令:
net stats workstation
4]使用PowerShell
您还可以使用 PowerShell 查找系统正常运行时间(find the System Uptime using PowerShell)。但同样,使用PowerShell、CMD和任务管理器(Task Manager),您只能计算正常运行时间而不能计算停机时间。
提示(TIP):内置SystemInfo工具可让您查看系统启动时间。它显示计算机启动的日期和时间。
如果您使用的是Windows Server,那么您可能需要一些更好的监控工具,但这些简单的方法也可以使用。此外,这些数字仅适用于关机和重启。这些数字不代表Sleep、Logoff、Logon或休眠时间。
额外提示(BONUS TIP):这篇文章将向您展示如何使用各种方法找出 Windows 安装日期。(find out the Windows Installation Date)
How to find out Windows Downtime, Uptime and Last Shutdown Time
Our Windows laptops and РCs keep runnіng for long these days. Can you remember the last time you shut down your PC? Users these days consіder putting theіr computers to Sleep in order to get back faster.
Now did you know that your computer logs the timestamp every time you shut down or start your computer? The total duration for which your computer has been running is called Uptime. And the duration for which the computer was powered off is called Downtime.
The uptime or downtime figures may not be important for an average daily user. But if you are using your computer as a server in your organization then these figures might be of interest. Also, if you are interested in monitoring your computer, these figures may help you out. In this post, we will discuss the ways you can find out Windows Downtime, Uptime, and the Last Shutdown Time
Find out Windows Downtime & Uptime
1] Using Event Viewer
The Event Viewer is a built-in Windows utility that lets you view various events logged by Windows. As I already mentioned, Windows logs the last shutdown and start-up time, and it can be found in Event Viewer.
Follow these steps to find out what was the last time your PC was ‘Shut down’.
- Go to Start and search for ‘Event Viewer’ and hit Enter.
- Expand ‘Windows Logs’ from the left ‘Console Tree’. And select ‘System’ from it.
- Wait for all the events to load. Now click on ‘Filter current log’ from the right ‘Action Pane’.
- Now in the text box that says “<All Event IDs>”, replace the text with “6005, 6006”.
- Refresh the current log.
- Sort the list based on the time and date of the logged event. The latest entries being on the top of the list.
Now you’ve filtered and sorted the list to give you all the required information. The first entry in the list with the Event ID 6006 gives you the last time your computer was Shut Down. And the first entry with ID 6005 gives you the time when the PC was started again. The difference between both the timestamps gives you the net downtime – or the duration for which the computer was in a completely powered-down state. Also, the difference between your current time and the last start time can give you the total uptime of your computer.
Current Time - Last Start Time = Total Uptime
Last Start Time - Last Shut Down Time = Total Downtime
2] Using Task Manager
This method is rather an easy way out to calculate Uptime, but it does not calculate Downtime. All you need to do is, open ‘Task Manager’ and go to ‘Performance’ tab. Select ‘CPU’ from the left menu and now look for ‘Uptime’ in the right section.
The total uptime would be displayed in DD:HH:MM:SS format. Using Task Manager will be fine if you are looking for current uptime only. It cannot display the entire history of events whereas in Event Viewer you can go back in time and view earlier event logs and calculate Uptime and Downtime accordingly.
3] Using CMD
Viewing the statistics of the Workstation service can also give you the last start time. To do so, open ‘CMD’ and type the following command:
net stats workstation
4] Using PowerShell
You can also find the System Uptime using PowerShell. But again, using PowerShell, CMD, and the Task Manager you can only calculate uptime and not downtime.
TIP: The built-in SystemInfo tool lets you view the System Boot Time. It displays the date and time at which the computer booted.
If you are working with Windows Server, then you may probably need some better monitoring tools, but these simple methods will also work. Also, these figures only apply to shutdowns and restarts. These figures do not represent Sleep, Logoff, Logon, or hibernation times.
BONUS TIP: This post will show you how to find out the Windows Installation Date using various methods.