Files
oki-podcast-reader/src/routes/api/code/seconds-to-timestamp.js
T

11 lines
316 B
JavaScript
Raw Normal View History

2023-07-29 17:57:14 +01:00
import { format_seconds } from 'svelte-podcast/utility/format-seconds';
2023-07-11 22:13:18 +01:00
// Example
2023-07-29 17:57:14 +01:00
format_seconds.to_timestamp(5173); // '01:26:13';
2023-07-11 22:13:18 +01:00
2023-07-29 17:57:14 +01:00
// force hours to be displayed
format_seconds.to_timestamp(2700, true); // '00:45:00';
// only display hours if there are any
format_seconds.to_timestamp(2700, false); // '45:00';