I have used moment-timezone in my react js project. date time conversion is showing correctly but Moment Timezone has no data for IST error is showing in console
import moment from "moment-timezone"; export function utcToDate() { const zone_name = moment.tz.guess(); const timezone = moment.tz(zone_name).zoneName(); return moment(1607954125191).tz(timezone).format("MMM DD YYYY, hh:mm A"); }
use zone_name instead of timezone
return moment(date).tz(zone_name).format("MMM DD YYYY, hh:mm A");
2.1m questions
2.1m answers
60 comments
57.0k users