HDCerberus
HDCerberus

Reputation: 2143

Date.parse returns NaN in Apps Script

In Apps script, if I use:

function test(){
  var parsedReminderDay = Date.parse("18-Sep-2016");
  Logger.log(parsedReminderDay)
}

The Apps script log returns 'NaN' for me:

enter image description here

However, testing this with pure JS, I get the expected '1474153200000' returned:

https://jsfiddle.net/zkfxdqg4/

Why? Is Apps script bugged, or is there something wrong with what I'm doing?

Upvotes: 0

Views: 473

Answers (1)

Harold
Harold

Reputation: 3337

This is because Google Apps Script do not run the las ECMA Script implementation (doc here). So for what I could read this is not implemented in this version.
Have a look at this post

Upvotes: 1

Related Questions