Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Creator(year, month, day, hours, minutes, seconds) {
- const args = arguments;
- const date = new Date;
- this.year = year || date.getFullYear();
- this.month = month || date.getUTCMonth() + 1;
- this.day = day || date.getUTCDate();
- this.hours = hours || date.getUTCHours();
- this.minutes = minutes ? minutes : date.getUTCMinutes();
- this.seconds = seconds ? seconds : date.getUTCSeconds();
- this.epoch = Date.UTC(this.year, this.month, this.day, this.hours, this.minutes, this.seconds);
- }
- const timer = new Creator();
- const finale = new Creator(2018, 10, 18, 11, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement