11

Wrong Uptime

The up time shown in the picture is 6 Days, 1 hour, 34 Minutes, 22 seconds. I turned on this Laptop just about 7 min ago.

I actually think it like, Windows 8 reports the total up time while in Hybrid-Boot mode. How do I get the real up time?? Also, why does Windows reports it that way??

Is there any way to get the real up time in GUI way (for my n00b friend)??


UPDATE: I disabled Hybrid-Boot and rebooted. It now results the right uptime. Also, doing a full shutdown with shutdown /s /t 0 also works.

Little more explanation, My question is that How to get the actual up-time (time from when we powered the system on) even if the Hybrid-Boot is enabled? Possibly in stock Windows without any external program, though not necessary.


Any explanation to this?

5
  • 1
    Can you clarify what you mean by "real up time"? What did you do 7 minutes ago exactly? Commented Mar 11, 2013 at 13:07
  • Real up time means the actual time from when I turned on the system. (That's what I did 7 min ago, turn on the Laptop!) Commented Mar 11, 2013 at 13:32
  • 8
    The legacy definition for uptime is the time that the computer has been running since the kernel initialized itself. Since hybrid boot is just a special type of suspend (there was previously suspend to RAM and Hibernate), it doesn't count as "shutting down", because the same instance of the Windows kernel is used. Commented Mar 11, 2013 at 13:56
  • @allquixotic True, That's why I thought it would be Hybrid-Boot up time. Commented Mar 11, 2013 at 14:15
  • I guess you din't actually got the Question. I want to ask that how to get the actual up-time even when Hybrid-Boot in enabled. I am updating the question. Commented Mar 12, 2013 at 14:25

4 Answers 4

6

You want to get an out-of-the-box solution to find out the uptime of your machine since the last hybrid shutdown / fast startup took place, right?

You can get this information (as provided by @allquixotic) from the EventLog using PowerShell like this:

PS c:\> Write-Host $("{0:c}" -f ((Get-Date)- (Get-EventLog -LogName system -Source "Microsoft-Windows-Power-Troubleshooter" -Newest 1).TimeGenerated))

To embed powershell command into a Windows shell script you can do this instead:

c:\> powershell.exe -nologo -command Write-Host $('Time since last ''Fast Startup'': {0:c}' -f ((Get-Date)- (Get-EventLog -LogName system -Source \"Microsoft-Windows-Power-Troubleshooter\" -Newest 1).TimeGenerated))

Howerver, to get this to work out of the box, you could set it into a permanent environment variable like this instead:

c:\> setx HardwareUptime "powershell.exe -nologo -command Write-Host $('Uptime since last ''Fast Startup'': {0:c}' -f ((Get-Date)- (Get-EventLog -LogName system -Source 'Microsoft-Windows-Power-Troubleshooter' -Newest 1).TimeGenerated))"

so, you can then get it to work by opening up a cmd window and doing:

c:\> %HardwareUpTime%

UPDATE:

I just found today that using the above entry in the event log will also take into account "Sleep" or suspend mode, so running %HardwareUpTime% will tell you the elapsed time since the PC resumed from sleeping if you let it do so.

Therefore, here it is:

setx HardwareUptime "powershell.exe -nologo -command Write-Host $('Uptime since hardware boot: {0:c}' -f ((Get-Date)- (Get-EventLog -LogName system -InstanceId 27 -Newest 1).TimeGenerated)); Write-Host $('Uptime since system resumed: {0:c}' -f ((Get-Date)- (Get-EventLog -LogName system -Source 'Microsoft-Windows-Power-Troubleshooter' -Newest 1).TimeGenerated));"

I've modified the command a little bit to be more explicit and give you both pieces of information:

  • Elapsed time since Windows booted (either after a hybrid shutdown, full shutdown or simple reboot or hibernation).

  • Elapsed time since Windows resumed execution (after returning from sleep mode).

NOTE: If the system didn't sleep in between, both times will be the same.

1
  • This seems to me like a nice solution. Commented Dec 21, 2013 at 17:58
4

Taken from here:

Check the Windows Event Log.

  1. Press Windows Key+r

  2. Enter in the box, %windir%\system32\eventvwr.msc /s

  3. Click "Create Custom View..." on the right-hand side.

  4. Set the settings like this: power-troubleshooter

  5. Click OK

  6. When prompted, give the custom view a name (this can be anything you want)

  7. It will display the list of resume times

3
  • Ok, Its nice. Its somewhat what I want. What if I am a n00b?? Its just not suitable. Also, It results the last resume time, for up time I need to minus it from my current time. Is there any direct method for up time, maybe in command-line?? I am up voting, but not accepting. Commented Mar 11, 2013 at 14:16
  • There's no shrinkwrapped solution for this AFAIK. You'd have to write a program. Maybe I will.... Commented Mar 11, 2013 at 15:04
  • Okay, I'll try that later maybe. Commented Mar 11, 2013 at 15:29
1

You should disable Hybrid-Boot and reboot. It should display the right uptime. Also, doing a full shutdown with shutdown /s /t 0 also works.

5
  • This is exactly what I wrote in Update Commented Mar 12, 2013 at 5:29
  • @AkshatMittal Yes it is, but I figured you'd like to accept an answer :)
    – Kruug
    Commented Mar 12, 2013 at 13:25
  • No. -_- The question is that "How to get the real up-time in GUI form?" Commented Mar 12, 2013 at 13:29
  • Well, first you would have to disable your Hybrid-Boot as uptime starts counting from the time the kernel was initialized. That's the only way.
    – Kruug
    Commented Mar 12, 2013 at 13:31
  • The only way, sure? Commented Mar 12, 2013 at 14:26
0

this also happens in older Version (XP, Vista,7) when you use hibernation. The time gets only reseted when you do a full boot, but the Win8 fast startup is no longer a full boot. It is a combination of logging the user off + Hibernation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .