javascript full date as string
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var today = new Date();
console.log(today.toLocaleDateString("en-US")); // 9/17/2016
console.log(today.toLocaleDateString("en-US", options)); // Saturday, September 17, 2016
console.log(today.toLocaleDateString("hi-IN", options)); <p>The toDateString() method converts a date to a date string:</p>
<p id="demo"></p>
<script>
var d = new Date();
document.getElementById("demo").innerHTML = d.toDateString();
</script>
//output: Fri Oct 16 2020
Also in JavaScript:
- ERROR in ./src/app/pages/auth/auth.module.ngfactory.js Module not found: Error: Can't resolve '@angular/material/core/index'
- javascript hide show div
- vuepress firebase authentication
- flutter background image
- cb=gapi.loaded_0:190 Uncaught TypeError: $.ajax is not a function
- Sum of all the multiples of 3 or 5
- jquert toggleClass condition
- join in array
- react big calendar event color
- react native image
- no response on stdout hackerrank javascript
- javascript countdown 10 seconds
- javascript open new window with html content
- js replace blogger thumb
- creating a nested loop of a chessboard in javascript
- javascript dom methods list
- javascript on url anchor change event
- send random memes discord.js
- jquery $.post
- hide checkbox jquery
- check the properties of an object in javascript
- javascript substring
- angular cors issue
- jsx in emmet