I'm having dates like the below:
05/30/2014 11:21:37 AM
My users will be entering in that data and having their own timezone. It could be anything like "US/Eastern", "US/Pacific-New", etc. I want to convert the time to UTC but i'm not able to. Is there a way to do so?
I'm using node and I tried momentJS and read the below:
Convert date to another timezone in JavaScript
How do I convert from a different timezone to UTC?
Edit
I have tried these:
moment().utc(0).format('YYYY-MM-DD HH:mm Z')
moment.tz(dateString, "US/Eastern").format()
In the above example dateString
is the string date. I want to set the timezone to "US/Eastern" and convert it to UTC.