This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
2022-07-05 12:28:31 -05:00
|
|
|
module.exports = (uptime) => {
|
|
|
|
const tSeconds = (uptime / 1000);
|
2022-07-05 11:55:42 -05:00
|
|
|
|
|
|
|
const tDays = parseInt(tSeconds / 86400);
|
|
|
|
const tHrs = parseInt((tSeconds % 86400) / 3600);
|
|
|
|
const tMins = parseInt((tSeconds % 3600) / 60);
|
|
|
|
const tSecs = parseInt(tSeconds % 60);
|
|
|
|
|
|
|
|
const days = tDays + (tDays === 1 ? ' day' : ' days');
|
|
|
|
const hours = tHrs + (tHrs === 1 ? ' hour' : ' hours');
|
2022-07-16 12:10:37 -05:00
|
|
|
const minutes = tMins + (tMins === 1 ? ' minute' : ' minutes');
|
2022-07-05 11:55:42 -05:00
|
|
|
const seconds = tSecs + (tSecs === 1 ? ' second' : ' seconds');
|
|
|
|
|
|
|
|
return `${days}, ${hours}, ${minutes}, ${seconds}`;
|
|
|
|
};
|