I have a response which is returning the dates as YYYY-MM-DD HH:MM:SS format. However, due to timezones issues, I am trying to convert these in to GMT format.
I tried directly converting them but Google script always takes these as Text and thus returns Jan 1, 1970 as the output when using a Date object.
I tried adding the timezone offset to the string and then converting, but to no avail.
Is there any way I can convert this format into a proper date or directly convert it into GMT?
dateValue = '2019-02-20 18:30:00'
var tempDate = dateValue + ' +0530';
dateValue = new Date(tempDate)
I'd expect the outcome to be returned as a date, which I can then convert to GMT format