I have a string in Javascript: '2008-03-09 18:02:29 UTC'
I want to convert it into a date object. So I do the following:
> new Date('2008-03-09 18:02:29 UTC')
This works fine in Google Chrome (Version 49.0.2623.87, 64-bit):
> new Date('2008-03-09 18:02:29 UTC');
Sun Mar 09 2008 14:02:29 GMT-0400 (EDT)
But when I do the same think in Firefox (Version 45.0.1), it fails:
> new Date('2008-03-09 18:02:29 UTC');
Invalid Date
Is there some code that I can write that will do this conversion properly in both browsers?