Метод getDate()
повертає день місяця для вказаної дати згідно з місцевим часом.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Синтаксис
dateObj.getDate()
Повертає
Ціле число між 1 та 31, що відображає день місяця для наданої дати згідно з місцевим часом.
Приклади
Використання getDate()
Друга інструкція, наведена нижче, присвоює значення 25 змінній day
на основі значення об'єкта Date
на ім'я Xmas95
.
var Xmas95 = new Date('December 25, 1995 23:15:30');
var day = Xmas95.getDate();
console.log(day); // 25
Специфікації
Сумісність з веб-переглядачами
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.