Formatted dates in a Google Apps script

前端 未结 3 349
抹茶落季
抹茶落季 2021-01-13 21:59

I\'m trying to get a spreadsheet with simple formatted dates when a form is submitted, but all dates, including the timestamp keep getting posted as \"Dec 31 1969 2:00PM\"..

3条回答
  •  伪装坚强ぢ
    2021-01-13 22:19

    I think the 'dates' in your spreadsheet are not date objects, they are just strings and JavaScript evaluate it as 0, that's why you get a date value of the 'origin' (aka epoch) minus GMT offset...depending on how these values comes in the cells there might be different solutions to this. Can you show example data an tell how they were created?

    To check if my guess is right you could simply try to change the display format of the 'date' cells using the spreadsheet interface.If you can change it there and get coherent results then I'm wrong... if not ... well I guess I'm right :-)

提交回复
热议问题