xxxxxxxxxx
moment.tz.setDefault("America/New_York");
xxxxxxxxxx
import moment from 'moment-timezone'
moment().tz(timezoneName).utcOffset()
xxxxxxxxxx
// Importing the necessary libraries
const moment = require('moment');
require('moment-timezone');
// Getting the current time in a specific time zone
const currentTime = moment().tz('America/New_York');
console.log(currentTime);
// Converting a specific date and time from one time zone to another
const originalDateTime = moment('2023-06-15 18:30:00').tz('America/Los_Angeles');
const convertedDateTime = originalDateTime.clone().tz('Asia/Tokyo');
console.log(convertedDateTime);
xxxxxxxxxx
const moment = require('moment-timezone')
moment.tz.setDefault("UTC");
xxxxxxxxxx
moment.tz(
new Date().toJSON().split('T')[0] + ' 5:00 PM',
'YYYY-MM-DD h:mm A',
'America/New_York'
)