Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pbTime = "2:24:26"
- var pbSeconds;
- pbSeconds = timeToSeconds(pbTime);
- pbSeconds = pbSeconds * (100000/86400);
- console.log(pbSeconds);
- function timeToSeconds(timeString) {
- const timeParts = timeString.split(":");
- const hours = parseInt(timeParts[0], 10);
- const minutes = parseInt(timeParts[1], 10);
- const seconds = parseInt(timeParts[2], 10);
- // Calculate the total seconds
- const totalSeconds = hours * 3600 + minutes * 60 + seconds;
- return totalSeconds;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement