Question: ```
 alert(new Date('2010-11-29'));

```

chrome, ff doesn't have problems with this, but safari cries "invalid date". Why ?

edit : ok, as per the comments below, I used string parsing and tried this : 

```
alert(new Date('11-29-2010')); //doesn't work in safari
alert(new Date('29-11-2010')); //doesn't work in safari
alert(new Date('2010-29-11')); //doesn't work in safari

```

**edit Mar 22 2018** : Seems like people are still landing here - Today, I would use `moment` or `date-fns` and be done with it. Date-fns is very much pain free and light as well.

Answer: 
For me implementing a new library just because Safari cannot do it correctly is too much and a regex is overkill.
Here is the **oneliner**:

```
console.log (new Date('2011-04-12'.replace(/-/g, "/")));

```
This will not work `alert(new Date('2010-11-29'));` safari have some weird/strict way of processing date format `alert(new Date(String('2010-11-29')));` try like this.

(Or)

Using Moment js will solve the issue though, After ios 14 the safari gets even weird

Try this alert(moment(String("2015-12-31 00:00:00")));

Moment JS