I've got a big problem with Twitter API created_at date, which has got following format: Tue Apr 18 07:24:05 +0000 2017
... I want to create javascript Date object from that, but I'm not able to find cross-browser solution. What I've tried so far:
new Date(Date.parse(input.replace(/( \+)/, ' UTC$1')));
– returns null in Safarinew Date((input || "").replace(/-/g,"/").replace(/[TZ]/g," "));
– returns null in IE11- moment.js library throws warning about deprecated method and falls back to javascript Date()
Can someone help me to figure it out? Thank you very much!