September 2024
Beginner to intermediate
985 pages
35h 37m
English
In addition to the global objects presented in the previous sections, there are others that are summarized (admittedly rather briefly) ahead.
For working with date and time information, JavaScript provides the Date object. To access date and time information, you must first create an instance of Date, as shown in Listing 4.118. Arguments can be passed (details to follow), but they can also be omitted. In the latter case, an instance is created that represents the current date and time.
Then, for example, you can use getMonth() to get the month, getFullYear() to get the year, getDate() to get the current day in the month, getDay() to get the current day in the week, ...
Read now
Unlock full access