Answers for "nodejs get date with format"

18

get date javascript format

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)); // शनिवार, 17 सितंबर 2016
Posted by: Guest on April-20-2021
0

Format javascript date with date.js library

const dayjs = require('dayjs');

let now = dayjs();

console.log(now.format());
Posted by: Guest on November-23-2021

Code answers related to "nodejs get date with format"

Code answers related to "Javascript"

Browse Popular Code Answers by Language