0

I want to format date to have something like this:

6.12.2017 10:44:33 

I want to use only js not any plugin.

I tried like this:

new Date(entry.duedate).toLocaleString() 

But this is not what i want because i get date like this : 6/12/2017

None
  • 6,894
  • 20
  • 72
  • 144
  • Hi. Look at the option of https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Date/toLocaleString – Xenofexs Jun 12 '17 at 13:50
  • 1
    You just need to replace the back slashes with dots, also you need to use toLocaleTimeString() https://jsfiddle.net/gefmang3/ – Mohamed Abbas Jun 12 '17 at 13:59

0 Answers0