Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const appointmentTime = timeSlot.slice(0, 5);
- const appointmentDate = date;
- const timeString = appointmentDate + " " + appointmentTime;
- // console.log("TIMESTRING", timeString);
- const myDate = new Date(timeString); // Your timezone!
- // console.log("MY DATE", myDate);
- // Below we're using moment-timezone to make the epoch time, which is defined as finalTime.
- const convertWithMoment = moment(myDate).format(
- "MM/DD/YYYY hh:mm A"
- );
- const finalTime = moment(convertWithMoment, "MM/DD/YYYY hh:mm A")
- .tz("America/Denver")
- .format("X");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement