Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript Short and Long date format

// short date format "MM/DD/YYYY"
const date = new Date("03/25/2015");
console.log(date); // Wed Mar 25 2015 00:00:00 GMT+0545

// long date format "MMM DD YYYY"
const date1 = new Date("Jul 1 2020");
console.log(date1); // Wed Jul 01 2020 00:00:00 GMT+0545

// month and day can be in any order
const date2 = new Date("1 Jul 2020");
console.log(date2); // Wed Jul 01 2020 00:00:00 GMT+0545

// month can be full or abbreviated. Also month names are insensitive.
// comma are ignored
const date3 = new Date("July 1 2020");
console.log(date3); // Wed Jul 01 2020 00:00:00 GMT+0545

const date4 = new Date("JULY, 1, 2020");
console.log(date4); // Wed Jul 01 2020 00:00:00
Comment

PREVIOUS NEXT
Code Example
Javascript :: discord.js v12 how to set owner commands 
Javascript :: parse string javascript 
Javascript :: arrow functions javascript 
Javascript :: event delegation javascript 
Javascript :: angular directive to trim input 
Javascript :: install react hotjar 
Javascript :: how to disable menu bar in browser using javascript 
Javascript :: Using An Array As A Parameter Of A Function 
Javascript :: chrome version 
Javascript :: javascript recursive on object of arrays 
Javascript :: js method .sort 
Javascript :: stop execution javascript 
Javascript :: how to filter items in react state 
Javascript :: repeating countdown timer javascript 
Javascript :: vue route automatic redirect 
Javascript :: toast notification angular bootstrap 8 
Javascript :: sum is not working in js 
Javascript :: how to apply reduce to an empty array in javascript 
Javascript :: import and export data in mongodb 
Javascript :: How to loop through an object in JavaScript with the Object.keys() method 
Javascript :: on enter to tab javascript 
Javascript :: isodate mongodb nodejs 
Javascript :: ForEach Element with Function or Lambda 
Javascript :: obfuscate js string 
Javascript :: momoent isafter or equal$ 
Javascript :: connect node with react 
Javascript :: of rxjs 
Javascript :: call function javascript from asp net 
Javascript :: pass value inside the js file using script tag 
Javascript :: moment get month day 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =