mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +00:00
feat: rename .js files to .ts
This commit is contained in:
1 parent
40bf9d926b
commit
92b1992b1a
54 files changed
No files matched your search
@@ -0,0 +1,24 @@
|
||||
exports.getUptimeFormatted = async ({ executionId }) => {
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'getUptimeFormatted.js',
|
||||
module: 'utilSystem',
|
||||
name: 'getUptimeFormatted',
|
||||
executionId: executionId
|
||||
});
|
||||
|
||||
try {
|
||||
let uptimeFormattedString = '';
|
||||
|
||||
const uptimeInSeconds = process.uptime();
|
||||
let uptimeDate = new Date(0);
|
||||
uptimeDate.setSeconds(uptimeInSeconds.toFixed(0));
|
||||
uptimeFormattedString = `${
|
||||
uptimeDate.getUTCDate() - 1
|
||||
}d ${uptimeDate.getUTCHours()}h ${uptimeDate.getUTCMinutes()}m ${uptimeDate.getUTCSeconds()}s`;
|
||||
|
||||
return uptimeFormattedString;
|
||||
} catch (error) {
|
||||
logger.error('Error retrieving or transforming uptime to formatted string.', error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user