Guest User

Untitled

a guest
Jun 15th, 2026
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. 'use strict';
  2.  
  3. var millisDigits = 0; //How many digits the milliseconds should have
  4. const date= "Jun 24, 2026 11:00:00"; //Date to count up from
  5. //-------------------------
  6. var timer = 0;
  7. var mins;
  8. var seconds;
  9. var hours;
  10. export function update(value) {
  11. if(timer<0){
  12. console.log(timer)
  13.  
  14. timer+= engine.frametime;
  15.  
  16. seconds = Math.abs(timer%60|0);
  17. mins = Math.abs((timer/60)%60|0);
  18. hours = Math.abs(timer/3600|0);
  19. if(mins<10){
  20. mins = "0"+mins;
  21. }
  22.  
  23. if(seconds <10){
  24. seconds = "0"+seconds;
  25. }
  26. if(hours<10){
  27. hours = "0"+hours;
  28. }
  29.  
  30. return hours+":"+ mins+":"+seconds;
  31. }
  32. return "00:00:00";
  33. }
  34. /**
  35. * @param {String} value - for property 'text'
  36. */
  37. export function init(value) {
  38. timer= (new Date().getTime()-new Date(date).getTime())/1000;
  39.  
  40. return value;
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment