The code is:
const date = new Date()
// Year
const YYYY = .getFullYear()
// Month
const M = date.getMonth() +1 ; const MM = ((M<10)?'0':'') + M.toString(10)
// Day
const D = date.getDate() ; const DD = ((D<10)?'0':'') + D.toString(10)
const myDate = `${DD} ${MM} ${YYYY}`
I tried to use:
const month = date.toLocaleString('default', { month: 'short' });
but the result was ‘juil’ instead of ‘Jul’
Is ther a way to get 1) the right short month name 2) in any human language ?
New contributor
Erebus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.