دالة 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()
البيان الثاني قام بتعيين قيمة المتغير day
، علي أساس قيمة تاريخ المتغير Xmas95
.
var Xmas95 = new Date('December 25, 1995 23:15:30');
var day = Xmas95.getDate();
console.log(day); // 25
الخصائص
Specification | Status | Comment |
---|---|---|
ECMAScript (ECMA-262) The definition of 'Date.prototype.getDate' in that specification. |
Living Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Date.prototype.getDate' in that specification. |
Standard | |
ECMAScript 5.1 (ECMA-262) The definition of 'Date.prototype.getDate' in that specification. |
Standard | |
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.1. |
دعم المتصفحات
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.