Advertisement
petschko

Untitled

Jan 23rd, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function timeStampToStr(timestamp) {
  2. var hours;
  3. var minutes;
  4. var sec;
  5. var timeStr;
  6.  
  7. // Get Hours
  8. hours = Math.floor(timestamp / 3600);
  9. timeStr =  hours + ':';
  10.  
  11. // Get Minutes
  12. minutes = Math.floor((timestamp - hours * 3600) / 60);
  13. timeStr += minutes + ':';
  14.  
  15. // Get secs
  16. sec = (timestamp - hours * 3600) - minutes * 60;
  17.  
  18. return timeStr + sec;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement