1getDate() in javascript only returns the day as number (1-31)
2
3Example
4var d = new Date();
5document.getElementById("demo").innerHTML = d.getDate();
6
7Output:
822
9
10Method Description
11getFullYear() Get the year as a four digit number (yyyy)
12getMonth() Get the month as a number (0-11)
13getDate() Get the day as a number (1-31)
14getHours() Get the hour (0-23)
15getMinutes() Get the minute (0-59)
16getSeconds() Get the second (0-59)
17getMilliseconds() Get the millisecond (0-999)
18getTime() Get the time (milliseconds since January 1, 1970)
19getDay() Get the weekday as a number (0-6)
20Date.now() Get the time. ECMAScript 5.
1let date = new Date(); //actual time in miliseconds
2let string = date.toString();
3// expected output: Wed Jul 28 1993 14:39:07 GMT+0200 (CEST)
4// if you need more power: date-fns.js or moment.js