How to convert date string value created with new Date().getTime()

Result: 1531223496095

I need to convert to normal, for example

12.06.2018 and indicate the hours and minutes

    2 answers 2

     var d = new Date(); console.log(d.toLocaleDateString('ru')); 

    Source: https://stackoverflow.com/a/14638063/6677992

    UPD:

    and indicate the hours and minutes

     var d = new Date(); console.log(d.toLocaleString('ru').substring(0,17)); 

      And why to do it through new Date().getTime() , if in the end you need a date anyway?
      It is possible, for example, or the second option is to transfer back to Date

       var d = new Date(); console.log(d.toLocaleDateString('ru')); var d = new Date().getTime(); var d = new Date(d); console.log(d.toLocaleDateString('ru', {hour: '2-digit', minute: '2-digit'})); 

      • Well, that would sort later - sinevitch
      • You do not know how to add more hours and minutes? - sinevitch