在JavaScript中,Date对象用于处理日期和时间。它提供了一系列方法来获取和设置日期、时间,以及与之相关的操作。其中,getDay()方法是用于获取星期几的方法之一。在本文中,我们将详细介绍JS Date对象的getDay()方法的用法、返回值以及示例代码。 getDay()方法概述 在JavaScript中,Date对象的getDay()方法用于获取当前日期...
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.Date_getDay)]publicstaticdoublegetDay(objectthisob); Parameters thisob Object The object that this method is acting upon. Returns
This method returns the day of the week of dateVar. Sunday is 0, and Saturday is 6. To get the name of the corresponding weekday, create an array holding the names of the days of the week and compare the return value to the array index, as shown in the following example....
This method returns the day of the week ofdateVar. Sunday is 0, and Saturday is 6. To get the name of the corresponding weekday, create an array holding the names of the days of the week and compare the return value to the array index, as shown in the following example. ...
ThegetDay()method returns the day of the week for the specified date according to local time, where 0 represents Sunday.For the day of the month, seeDate.prototype.getDate(). Syntax dateObj.getDay() Return value An integer number, between 0 and 6, corresponding to the day of the week...
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.Date_getDay)]publicstaticdoublegetDay(objectthisob); Parameters thisob Object The object that this method is acting upon. Returns
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.Date_getDay)]publicstaticdoublegetDay(objectthisob); Parameters thisob Object The object that this method is acting upon. Returns
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.Date_getDay)]publicstaticdoublegetDay(objectthisob); Parameters thisob Object The object that this method is acting upon. Returns
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.Date_getDay)]publicstaticdoublegetDay(objectthisob); Parameters thisob Object The object that this method is acting upon. Returns
This method returns the day of the week ofdateVar. Sunday is 0, and Saturday is 6. To get the name of the corresponding weekday, create an array holding the names of the days of the week and compare the return value to the array index, as shown in the following example. ...