Date.prototype.getDate()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015å¹´7æ.
getDate() 㯠Date ã¤ã³ã¹ã¿ã³ã¹ã®ã¡ã½ããã§ãå°æ¹æã«åºã¥ãããã®æ¥ä»ã®ãæ¥ããè¿ãã¾ãã
試ãã¦ã¿ã¾ããã
const birthday = new Date("August 19, 1975 23:15:30");
const date1 = birthday.getDate();
console.log(date1);
// äºæ³ãããçµæ: 19
æ§æ
js
getDate()
弿°
ãªãã
è¿å¤
1 ãã 31 ã¾ã§ã®éã®æ´æ°å¤ãå°æ¹æã«åºã¥ããæå®ãããæ¥æã®ãæ¥ãã表ãã¾ããæ¥æãç¡å¹ãªå ´å㯠NaN ãè¿ãã¾ãã
ä¾
>getDate() ã®ä½¿ç¨
以ä¸ã® 2 è¡ç®ã®æã¯ãDate ãªãã¸ã§ã¯ãã§ãã xmas95 ã®å¤ã«åºã¥ãã夿° day ã« 25 ã¨ããå¤ã代å
¥ãã¾ãã
js
const xmas95 = new Date("1995-12-25T23:15:30");
const day = xmas95.getDate();
console.log(day); // 25
仿§æ¸
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-date.prototype.getdate> |