New util for monsterplants

This commit is contained in:
object 2022-08-13 19:29:58 +00:00
parent 2fa3662860
commit da66f518a0

View 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');
}