mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 07:30:51 +01:00
New util for monsterplants
This commit is contained in:
parent
2fa3662860
commit
da66f518a0
9
src/api/utils/ConvertSeconds.ts
Normal file
9
src/api/utils/ConvertSeconds.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export const ConvertSeconds = (seconds: number) =>
|
||||
{
|
||||
let numDays = Math.floor(seconds / 86400);
|
||||
let numHours = Math.floor((seconds % 86400) / 3600);
|
||||
let numMinutes = Math.floor(((seconds % 86400) % 3600) / 60);
|
||||
let numSeconds = ((seconds % 86400) % 3600) % 60;
|
||||
|
||||
return numDays.toString().padStart(2, '0') + ':' + numHours.toString().padStart(2, '0') + ':' + numMinutes.toString().padStart(2, '0') + ':' + numSeconds.toString().padStart(2, '0');
|
||||
}
|
Loading…
Reference in New Issue
Block a user