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
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
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'})); Source: https://ru.stackoverflow.com/questions/852656/
All Articles