I am attempting to set the variable "formattedLocalTime" to Pacific time using the following snippet of code.
Despite the fact that the chrome debugger shows "locTime" as "Tue Sep 30 2014 16:17:25," which is the expected value, the formattedLocalTime on the last line displays "09/30/2014 11:17 pm," which is in UTC time and not the specified timezone of America/Los_Angeles. It should actually be "09/30/2014 4:17 pm" instead of 11:17.
Any suggestions would be greatly appreciated.
var timestamp = 1412144245453; // Tue Sep 30 2014 23:17:25
var utc = moment.tz(timestamp, "Etc/UTC"); // Tue Sep 30 2014 23:17:25 (displayed in chrome debugger)
var locTime = utc.clone().tz("America/Los_Angeles"); // Tue Sep 30 2014 16:17:25 (displayed in chrome debugger)
var formattedLocalTime = moment(locTime).format("MM/DD/YYYY h:mm a")