I know there are various ways using which we can convert date time into Unix timestamp.
But the problem is when we convert GMT's Date time value into Unix timestamp then it shows the value of timestamp according to my local timezone's value i.e. Asia/Kolkata
For example: Date time of GMT is: 2018-08-21 11:37:56 So when I am converting it into Unix timestamp then it returns as follows:
var t = new Date('2018-08-21 11:37:56').getTime() / 1000;
console.log(t); // 1534831676
I am looking for 1534851476
which is a value according to the GMT time zone.
which is Unix timestamp according to my local time zone Asia/Kolkata. Can anyone help me out to get Unix timestamp value into GMT?
For more information: you can check the Unix timestamp value of GMT date time here on this link.
Thank you!
new Date('2018-08-21T11:37:56Z').getTime() / 1000
– Jaromanda X'2018-08-21 11:37:56'.replace(' ', 'T')+'Z'
– Jaromanda X