SQL PHP HTML ASP JavaScript articles and free scripts to download
 

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




Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
Date & Time