Timezone conversions using MomentJS

Convert datetime in a timezone to UTC

moment.tz("2012-11-04 03:00:00", "America/New_York").utc().format('YYYY-MM-DD HH:mm:ss');

Convert UTC to datetime in a particular timezone

moment.utc("2012-11-04 08:00:00").tz("America/New_York").format('YYYY-MM-DD HH:mm:ss');

Leave a Reply

Your email address will not be published. Required fields are marked *