Date
实例的 getDate()
方法根据当地时间返回该日期是月份中的哪一天。
¥The getDate()
method of Date
instances returns the day of the month for this date according to local time.
¥Return value
1 到 31 之间的整数,表示根据当地时间给定日期的月份中的第几天。如果日期是 invalid,则返回 NaN
。
¥An integer, between 1 and 31, representing the day of the month for the given date according to local time. Returns NaN
if the date is invalid.
¥Using getDate()
基于 Date
对象 xmas95
的值,day
变量具有值 25
。
¥The day
variable has value 25
, based on the value of the Date
object xmas95
.
const xmas95 = new Date("1995-12-25T23:15:30");
const day = xmas95.getDate();
console.log(day);
BCD tables only load in the browser