//27 <- today day number
new Date().getDay() = new Date().getUTCDay() //<- 5 (friday)? what?
Do I have to parse the result with .toString()
or use something like YUI.Date.format()
?
JavaScript getDate() Method: This method returns the number of days in a month (from 1 to 31) for the defined date. Return value: It returns a number, from 1 to 31, representing the day of the month.
Javascript date getDate() method returns the day of the month for the specified date according to local time. The value returned by getDate() is an integer between 1 and 31.
@Codo - yes, good reply. ECMA-262 15.9. 1.15 applies. The OP should use "2011-09-24T20:00:00-04:00" or similar.
You're looking for .getDate()
:
new Date().getDate();
.getDay()
returns the day number 0 (Sunday) to 6 (Saturday).
The one you are looking for is .getDate()
, not .getDay()
Date Object Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With