Get date value from spreadsheet using Google apps script

43
May 18, 2019, at 5:50 PM

I have been struggling to get proper "date" from spreadsheet using google apps script. So below is scenario:
1. Google form submits request in Spreadsheet which has date column. so if request is submitted, spreadsheet saves date in local time zone. e.g. I have date "20/05/2019 09:00:00" which is already in local time zone(GMT+9:00).

  1. Now, I read this value from google apps script using
    var startTime = sheetObj.getRange(38, 6).getValue(). This returns date object which adds 9 hours to time again. so I get date value as "Mon May 20 18:00:00 GMT+09:00 2019". since my date is already in local time zone, I don't want to apply time timezone again. My expected output is "Mon May 20 9:00:00 GMT+09:00 2019" with date object.

But when I use getDisplayedValues, I get exact stored value but I need date as date object to create event in calendar with this date.

Am I missing something here? My time zone of calendar, spreadsheet and Script are same- GMT+09:00.

Thank you in advance.

READ ALSO
How does data conversion work between HTML and JavaScript?

How does data conversion work between HTML and JavaScript?

HTML5 documents are encoded in UTF-8, this means 1byte (8bits) per character

19
How to show all divs again when no filter-checkboxes are checked anymore?

How to show all divs again when no filter-checkboxes are checked anymore?

I've built a little filterDepending on the checkboxes you check, it will show boardgames for a certain amount of players and a certain amount of playing time

12
Text is not appearing after the second insert

Text is not appearing after the second insert

these code is working except that for the second or subsequent insert, the message 'Order added' is not appearingSecondly, after I removed everything using pop and click to view current order, the message 'No customer orders at the moment

21