mardi 23 août 2016

Moment js format date with timezone

Hi I am using Ember+moment.js to format date in my ember helpers.

I am getting the following date from the service

Tue Aug 23 2016 09:43:53 GMT+0200 (W. Europe Daylight Time)

In my ember helper class i am able to format date using following code :

var formattedDate = moment(date).format('DD/MM/YYYY h:mm a');

I am getting the following output :

23/08/2016 9:43 am

Expected Output : 23/08/2016 9:43 am GMT

How can i specify the timezone flag in the format function?

Any help should be appreciated.




Aucun commentaire:

Enregistrer un commentaire