![]() ![]() Here 0 represents the first month of the year. ![]() Likewise, the getMonth() method returns the number of months (from 0 to 11) instead of name of the month. The getDay() method returns a number representing the day of the week (from 0 to 6) instead of returning a name such as Sunday or Monday in such a way that, if it is Sunday, the method returns 0 and if it is Monday, the method returns 1, and so on. Example Try this code » var d = new Date() Īlert(d.getDate()) // Display the day of the monthĪlert(d.getDay()) // Display the number of days into the week (0-6)Īlert(d.getMonth()) // Display the number of months into the year (0-11)Īlert(d.getFullYear()) // Display the full year (four digits)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |