Answers for "date javascript only show day month year"

4

how to get only month and year in js

let dateObj = new Date();

let myDate = (dateObj.getUTCFullYear()) + "/" + (dateObj.getMonth() + 1)+ "/" + (dateObj.getUTCDate());
Posted by: Guest on May-14-2020
0

date javascript only show day month year

const event = new Date('2021-09-07');

const options = { year: 'numeric', month: 'long' };

console.log(event.toLocaleDateString('de-DE', options));
// expected output: September 2021

console.log(event.toLocaleDateString('ja-JP', options));
// expected output: 2021年9月
Posted by: Guest on September-07-2021

Code answers related to "date javascript only show day month year"

Code answers related to "Javascript"

Browse Popular Code Answers by Language