I am trying to initialize time of los_angles time zone in moment. But it is throwing the following error:
Moment Timezone has no data for 2018-08-08T10:00:00
Following is my code:
moment().tz("2018-08-08T10:00:00","YYYY-MM-DDTHH:mm:ss",true,"America/Los_Angeles").format("YYYY-MM-DDTHH:mm:ss");
You are supposed to remove ()
at moment
from moment().tz(..)
. The correct one is moment.tz(..)
as in
moment.tz("2018-08-08T10:00:00","YYYY-MM-DDTHH:mm:ss",true,"America/Los_Angeles").format("YYYY-MM-DDTHH:mm:ss");
it gives me result
"2018-08-08T10:00:00"