Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const timeSlot = "Wednesday, March 04 2020 11:00" // This is just an example of the string I am getting from the timeslot arg
  2. const appointmentTime = timeSlot.slice(0, 5);
  3.             const appointmentDate = date;
  4.             const timeString = appointmentDate + " " + appointmentTime;
  5.             const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
  6.             console.log(tz);
  7.             const finalTime = moment(timeString)
  8.               .tz(tz)
  9.               .format("X");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement