Javascript format date / time
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)); new Date().toISOString().slice(0, 16).replace("T", " ")var date = new Date('2014-8-20');
console.log((date.getMonth()+1) + '/' + date.getDate() + '/' + date.getFullYear());
Also in JavaScript:
- ready function javascript
- remove duplicates from array of objects javascript
- javascript add div to body with class
- recursive permutation
- Prevent Double Submit with JavaScript
- javascript check if string contains a text substring
- how to go back one directory in git bash
- upload file from url javascript
- java script functions
- jquery onload event
- check for balanced parentheses in javascript
- jquery enable textbox
- for of and for in javascript
- find least common multiple javascript
- javascript loop object
- render react in blaze
- node js read file from s3 bucket
- how to make an alphabet in javascript
- add condition inside a className in reactjs
- remove duplicates from array
- strict equality
- How to write on a web page javascript
- palindrome string js
- string contains js