Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function Creator(year, month, day, hours, minutes, seconds) {
  2. const args = arguments;
  3. const date = new Date;
  4. this.year = year || date.getFullYear();
  5. this.month = month || date.getUTCMonth() + 1;
  6. this.day = day || date.getUTCDate();
  7. this.hours = hours || date.getUTCHours();
  8. this.minutes = minutes ? minutes : date.getUTCMinutes();
  9. this.seconds = seconds ? seconds : date.getUTCSeconds();
  10. this.epoch = Date.UTC(this.year, this.month, this.day, this.hours, this.minutes, this.seconds);
  11. }
  12.  
  13. const timer = new Creator();
  14. const finale = new Creator(2018, 10, 18, 11, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement