I found several ones but I'm just not satisfied with them, they are too complicated in my opinion.
Well here is my solution that displays the starting time of the system and the elapsed time since start (the uptime).
I think it is simplified enough and gives opportunity for easy customization.
t_TimeFormat := "HH:mm:ss" t_StartTime := ; Clear variable = A_Now t_UpTime := A_TickCount // 1000 ; Elapsed seconds since start t_StartTime += -t_UpTime, Seconds ; Same as EnvAdd with empty time FormatTime t_NowTime, , %t_TimeFormat% ; Empty time = A_Now FormatTime t_StartTime, %t_StartTime%, %t_TimeFormat% t_UpTime := % t_UpTime // 3600 ":" mod(t_UpTime // 60, 60) ":" mod(t_UpTime, 60) MsgBox 64, Uptime, % "Start time: `t" t_StartTime "`nTime now:`t" t_NowTime "`n`nElapsed time:`t" t_UpTimeThis does not shows the day number in uptime, just the hours.
If you rarely switch off the computer you might want to see the days too, then try this:
t_TimeFormat := "HH:mm:ss dddd" t_StartTime := ; Clear variable = A_Now t_UpTime := A_TickCount // 1000 ; Elapsed seconds since start t_StartTime += -t_UpTime, Seconds ; Same as EnvAdd with empty time FormatTime t_NowTime, , %t_TimeFormat% ; Empty time = A_Now FormatTime t_StartTime, %t_StartTime%, %t_TimeFormat% t_UpTime := % t_UpTime // 86400 " days " mod(t_UpTime // 3600, 24) ":" mod(t_UpTime // 60, 60) ":" mod(t_UpTime, 60) MsgBox 64, Uptime, % "Start time: `t" t_StartTime "`nTime now:`t" t_NowTime "`n`nElapsed time:`t" t_UpTimeYou can remove the t_StartTime := line if you are going to use the script inside a function or if you execute it only once in the script's lifetime.