Skip to content

Function: formatUptime() ​

ts
function formatUptime(totalSeconds): string;

Formats seconds as a human-readable uptime string. 秒数转运行时长字符串。

Parameters ​

ParameterType
totalSecondsnumber

Returns ​

string

Example ​

ts
formatUptime(90061) // => '1 天 1 小时 1 分'

Since ​

1.3.0

Released under the MIT License.