|
|
toLocaleString()We can convert date object to local string format by using toLocalString function.
Date.toLocaleString();
Sample code
<script type="text/javascript">
var dt= new Date();
document.write(dt + "<br><br>");
document.write(dt.toLocaleString());
</script>
The output is here
| |
| | |
|
|
|
|
|