Friday, 17 March 2017

How to add timestamp in local time in momentjs

I am using moment.js and have date and time in number/timestamp. I want to convert it in my local timestamp i.e, GMT+5:30. Here is jsfiddle link.

code:-

console.log(moment(1489689000000).add(52200000).toDate())

  //output: Fri Mar 17 2017 14:30:00 GMT+0530 (IST)
 //expected output : Fri Mar 17 2017 20:00:00 GMT+0530 (IST)



via user7104874

No comments:

Post a Comment