Desired return value should be a string formatted as dd-mm-yyyy
.
Im trying to give a format date dd-mm-yyyy to ISOString and adding GMT but the code gives me this format. How can i do?
new Date().toISOString()
.replace(/T/, ' '). // replace T with a space
.replace(/\..+/, ''); // delete the dot and everything after
'2012-11-04 14:55:45'