getDate() |
It returns the date of the month from the given date object.
var d = new Date("2019-10-11");
|
getDay() |
It returns the day of the week from 0 to 6 according to the local time of the given date object. the
var d = new Date("2019-10-11");
|
getFullYear() |
It returns the full year of the given date object.
var d = new Date("2019-10-11");
|
getHours() |
It returns the hour (0-23) of the given date object.
var d = new Date("2019-10-11 16:30:33")
|
getMilliseconds() |
It returns the milliseconds (0-999) of the given date object according to the local time.
var d = new Date("October 11, 2019 16:30:33");
|
getMinutes() |
It returns the minute (0-59) of the given date object according to the local time.
var d = new Date("October 11, 2019 16:30:33")
|
getMonth() |
It returns the month (0-11) of the given date object according to the local time.
var d = new Date("October 11, 2019 16:30:33")
|
getSeconds() |
It returns the seconds (0-59) of the given date object according to the local time.
var d = new Date("October 11, 2019 16:30:33")
|
getTime() |
It returns the number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC.,
var d = new Date("October 11, 2019 16:30:33")
|
getTimezoneOffset() |
It returns the difference between UTC and local timezone in minutes.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCDate() |
It returns the day of the month (1-31) according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCDay() |
It returns the day of the week (0-6) according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCFullYear() |
It returns the year according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCHours() |
It returns the hour (0-23) according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCMilliseconds() |
It returns the milliseconds (0-999) according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCMinutes() |
It returns the minutes according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCMonth() |
It returns the month (0-11) according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33");
|
getUTCSeconds() |
It returns seconds (0-59) according to the universal time of the given date object.
var d = new Date("October 11, 2019 16:30:33")
|
setDate() |
It is used to set the date of a month to the date object in local time.
var d = new Date("October 11, 2019 16:30:33");
|
setFullYear() |
It is used to set the year to the date object in local time.
var d = new Date("October 11, 2019 16:30:33");
|
setHours() |
It is used to set hour (0-23) to the date object in local time.
var d = new Date("October 11, 2019 16:30:33");
d.setHours(19);
console.log(d.getHours()); // 19
|
setMilliseconds() |
It is used to set milliseconds to the date object in local time.
var d = new Date("October 11, 2019 16:30:33");
d.setMilliseconds(200);
console.log(d.getMilliseconds()); // 200
|
setMinutes() |
It is used to set minutes (0-59) to the date object in local time.
var d = new Date("October 11, 2019 16:30:33");
d.setMinutes(20);
console.log(d.getMinutes()); // 20
|
setMonth() |
It is used to set month (0-11) to the date object in local time.
var d = new Date("October 11, 2019 16:30:33");
d.setMonth(8);
console.log(d.getMonth()); // 8
|
setSeconds() |
It is used to set seconds (0-59) to the date object in local time.
var d = new Date("October 11, 2019 16:30:33");
d.setSeconds(34);
console.log(d.getSeconds()); // 34
|
setTime() |
It is used to set milliseconds after January 1, 1970, 00:00:00 UTC to the date object in local time.,
var d = new Date("October 11, 2019 16:30:33");
d.setTime(1570815753000);
console.log(d.toDateString()); // "Fri Oct 11 2019"
|
setUTCDate() |
It is used to set the date of the month (0-11) to the date object according to universal time.
var d = new Date("October 11, 2019 16:30:33");
d.setUTCDate(12);
console.log(d.getDate()); // 12
|
setUTCFullYear() |
It is used to set the year to the date object according to universal time.
var d = new Date("October 11, 2019 16:30:33");
d.setUTCFullYear(2018);
console.log(d.getFullYear()); // 2018
|
setUTCHours() |
It is used to set hours (0-23) to the date object according to universal time.
var d = new Date("October 11, 2019 16:30:33");
d.setUTCHours(16);
console.log(d.getHours()); // 21
|
setUTCMilliseconds() |
It is used to set milliseconds to the date object according to universal time.
var d = new Date("October 11, 2019 16:30:33");
d.setUTCMilliseconds(166);
console.log(d.getMilliseconds()); // 166
|
setUTCMinutes() |
It is used to set minutes (0-59) to the date object according to universal time.
var d = new Date("October 11, 2019 16:30:33");
d.setUTCMinutes(22);
console.log(d.getMinutes()); // 52
|
setUTCMonth() |
It is used to set month (0-11) to the date object according to universal time.
var d = new Date("October 11, 2019 16:30:33");
d.setUTCMonth(8);
console.log(d.getMonth()); // 8
|
setUTCSeconds() |
It is used to set seconds (0-59) to the date object according to universal time.
var d = new Date("October 11, 2019 16:30:33");
d.setUTCSeconds(10);
console.log(d.getSeconds()); // 10
|