getdate yyyy mm dd format javascript
let today = new Date();
let dd = today.getDate();
let mm = today.getMonth()+1;
const yyyy = today.getFullYear();
if(dd<10)
{
dd=`0${dd}`;
}
if(mm<10)
{
mm=`0${mm}`;
}
today = `${mm}-${dd}-${yyyy}`;
console.log(today);
today = `${mm}/${dd}/${yyyy}`;
console.log(today);
today = `${dd}-${mm}-${yyyy}`;
console.log(today);
today = `${dd}/${mm}/${yyyy}`;
console.log(today);
// GET FUll DATE WITH DAY, MONTH and YEARS
Also in JavaScript:
- compare string length javascript
- javascript array group by
- sum of odd numbers in an array javascript without loop
- How to abreviate digits in js
- scroll page to top after ajax success
- siwtch case javascript
- angular material theme colors
- on modal close jquery
- usb react native device not found
- random item from array javascript
- jquery ajax promise
- the original image of nodejs image
- email regex javascript
- javascript write to file
- sequelize query result
- add coustom handlechange fprmik
- isnan in javascript
- jquery get all classes of a div
- count number of each element in array javascript
- can we use two versions of jquery in same page
- js convert obj to array
- angular get response headers
- jquery clear chozen
- js append en tête