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