Advertisement
Guest User

Untitled

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