JavaScript

Date.prototype.getDate()メソッド

 編集:2022.11.12 by T.A.

[Edge]。→

Date の、地方時に基づく「日」を表す整数値(1~31)を返します。

構文
Date.getDate()
Date Date
返値

整数の数値。

以下の 2 行目の文は、Date オブジェクト Xmas95 の値に基づき、変数 day に 25 という値を代入します。

var Xmas95 = new Date('December 25, 1995 23:15:30');
var day = Xmas95.getDate(); //=25

テスト