0

Not really sure why this is happening, what I am trying to do is compare todays date to the date in my spreadsheet but this is not working correctly because the date is being parsed as from 1918.

So when I try to do a getTime() on the date it comes up with a negative number, this to my knowledge is because time started to be counted in 1970 so 1918 is before 1970 therefore it is a negative number.

Point is not sure why the dates in my sheet are being parsed from the year 1918?

Rubén
  • 34,714
  • 9
  • 70
  • 166
  • 1
    Save yourself a lot of trouble and stop storing datetimes in an ambiguous format. Store a full, timezone-aware datestring. Once you do that, the problems caused by your Apps Script project using JavaScript (you can't change that) and Google Sheets using an alternate `Date` representation (you can't change that either) will go away. – tehhowch Jun 04 '18 at 19:55
  • Possible duplicate of [How to read the correct time values from Google Spreadsheet](https://stackoverflow.com/questions/17715841/how-to-read-the-correct-time-values-from-google-spreadsheet) – Rubén Jun 05 '18 at 02:43
  • This is the format that google sheets uses when you choose a date from their calendar picker – Jack Silverman Jun 08 '18 at 22:02

0 Answers0