Date toLocaleString()

Date type's toLocaleString() returns the date and time in a locale format.

 
<!DOCTYPE html>
<html>
<head>
    <title>Example</title>
    <script type="text/javascript">
        var aDate = new Date(Date.UTC(2000, 0)); 
        document.writeln(aDate);
        document.writeln(aDate.toLocaleString());
       
    </script>
</head>
<body>
</body>
</html>
  
Click to view the demo
Home 
  JavaScript Book 
    Essential Types  

Date:
  1. Date Type
  2. Date getter
  3. Date Setter
  4. Date.parse()
  5. Date.UTC()
  6. Date.now()
  7. Date toLocaleString()
  8. Date toString()
  9. Date valueOf()
  10. Date toDateString()
  11. Date toTimeString()
  12. Date toLocaleDateString()
  13. Date toLocaleTimeString()
  14. Date toUTCString()