Guest User

Untitled

a guest
Apr 24th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. mergeTime(time, date) {
  2. console.log(time);
  3. console.log(date);
  4. const dateString = `${date.getDay()}/${date.getMonth()}/${date.getFullYear()}`;
  5. const timeString = `${time.getHours()}:${time.getMinutes()}:00`;
  6. const merged = new Date(`${dateString} ${timeString}`);
  7. console.log(merged);
  8. return this.timestamp(merged);
  9. }
  10.  
  11. Tue Apr 24 2018 15:00:00 GMT-0400 (Eastern Daylight Time)
  12.  
  13. Thu Apr 12 2018 02:42:07 GMT-0400 (Eastern Daylight Time)
  14.  
  15. Tue Apr 03 2018 15:00:00 GMT-0400 (Eastern Daylight Time)
  16.  
  17. timestamp(timeString) {
  18. return new Date(timeString).getTime();
  19. }
Add Comment
Please, Sign In to add comment