Advertisement
varden

gopro date formatter

Mar 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. var endDate = item.modifiedDate;
  2. var duration = item.videoDuration;
  3.  
  4. var startDate = new Date(endDate - duration);
  5.  
  6. var output = "";
  7.  
  8. if (startDate.getDate() < 10) {
  9. output += "0";
  10. }
  11. output += startDate.getDate();
  12.  
  13. if (startDate.getMonth() < 10) {
  14. output += "0";
  15. }
  16. output += startDate.getMonth();
  17.  
  18. output += " - ";
  19.  
  20. if (startDate.getHours() < 10) {
  21. output += "0";
  22. }
  23. output += startDate.getHours();
  24.  
  25. if (startDate.getMinutes() < 10) {
  26. output += "0";
  27. }
  28. output += startDate.getMinutes();
  29.  
  30. return output;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement