Spaces:
Configuration error
Configuration error
Download src/utils/time.js from UUUZCX/video-optimizer-bot: direct link, hf CLI and curl.
- Browser
- Download file 439 Bytes
-
https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/utils/time.js
- Command line
-
hf download hf://spaces/UUUZCX/video-optimizer-bot/src/utils/time.js
-
curl -L -o time.js https://huggingface.co/spaces/UUUZCX/video-optimizer-bot/resolve/main/src/utils/time.js
439 Bytes
| function nowIso() { | |
| return new Date().toISOString(); | |
| } | |
| function secondsToClock(seconds) { | |
| const safe = Math.max(0, Math.round(Number(seconds) || 0)); | |
| const h = Math.floor(safe / 3600); | |
| const m = Math.floor((safe % 3600) / 60); | |
| const s = safe % 60; | |
| return h > 0 | |
| ? `${h}:${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}` | |
| : `${m}:${String(s).padStart(2, "0")}`; | |
| } | |
| module.exports = { nowIso, secondsToClock }; | |