Guest User

Untitled

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