Browse the docs

uptime

Returns the seconds since the Mac started up.

Keyboard Maestro: UPTIME

Details #

uptime() takes no arguments and returns a number: the fractional seconds the Mac has been running since it last started. The time the Mac spent asleep is not counted. It is a steady clock. To time something, subtract an earlier reading from a later one.

Parameters #

Takes 0 arguments. {{ uptime() }}

Examples #

uptime()
→ 462185
uptime() / 3600
→ 128.385

Gotchas #

  • Calling it with an argument is an error: uptime() takes 0 arguments, got 1.

  • It is not a clock time. Use now() or date() for the time of day.