本文共 687 字,大约阅读时间需要 2 分钟。
getdate 日期间隔
getDate() method is a Date's class method and it is used to get the current day of the month.
getDate()方法是Date的类方法,用于获取当月的当前日期。
It accepts nothing as the parameter and returns a value between 1 to 31 (based on the day of the month).
它不接受任何内容作为参数,并返回1到31之间的值(基于月中的日期)。
Syntax:
句法:
var dt = new Date(); dt.getDate();
Examples:
例子:
Input: var dt = new Date(); dt.getDate(); Output: 4 // if date is 04/any month/any year
JavaScript code to get the current day of the month using getDate() method
JavaScript代码使用getDate()方法获取当月的当前日期
JavaScipt Example
Output
输出量
Today's date is: 4
翻译自:
getdate 日期间隔
转载地址:http://ryazd.baihongyu.com/