Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function timeStampToStr(timestamp) {
- var hours;
- var minutes;
- var sec;
- var timeStr;
- // Get Hours
- hours = Math.floor(timestamp / 3600);
- timeStr = hours + ':';
- // Get Minutes
- minutes = Math.floor((timestamp - hours * 3600) / 60);
- timeStr += minutes + ':';
- // Get secs
- sec = (timestamp - hours * 3600) - minutes * 60;
- return timeStr + sec;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement