I use JavaScript and jQuery, and I have a line like this (immutable xml response):
var str = "2017-01-08T16:06:52+00:00";
How can I convert to Date as follows:
08 january 2017, 16:06:52
Or at least:
08 01 2017, 16:06:52
I tried to use .replace()like:
str = str.replace(/(\d{4})-(\d{2})-(\d{2})T(\d{8}).*/,'$2 $3 $1, $4');
But this does not work. :(
source
share