There are a multitude of methods available for converting date time into Unix timestamp.
The issue arises when trying to convert the date time of GMT into Unix timestamp as it displays the value of the timestamp based on my local timezone (Asia/Kolkata).
For instance: If the GMT date time is: 2018-08-21 11:37:56 and I convert it into Unix timestamp, I get:
var t = new Date('2018-08-21 11:37:56').getTime() / 1000;
console.log(t); // 1534831676
What I need is 1534851476
, which corresponds to the GMT time zone.
This is the Unix timestamp value as per my local time zone Asia/Kolkata. Can someone assist me in obtaining the Unix timestamp value in GMT?
For additional information: you can view the Unix timestamp value of the GMT date time on this site linked here.
Thank you!