Here is a valid date string (coming from my database server):
Creating a date object is simple:
and this works great in every browser except Safari. Safari tells you you have an "invalid date".
After screwing around way too much, I found that this works:
And so, I changed my code to:
dateString='2012-01-31T00:00:00'.replace(/t.*$/, '').replace(/-/g, '/'); //ie, '2012/01/31'
I'm guessing that, if you needed the time, you'd have to split that off the string and use:
but I don't have time, or need, to figure that out now.