• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Manipulating Information > Using the Date and Time

Using the Date and Time

The Date object lets you retrieve the local or universal (GMT) date and time information from the clock in your viewer’s computer system. Using the Date object, you can retrieve the year, month, date, day of the week, hour, minute, second, and millisecond. Use the Date object and its methods to create accurate clocks in your movie or to find information about certain days and dates in the past. You can create a Date object for your birthday, for example, by specifying the month, date, and year. Using methods of the Date object, you can retrieve the day of the week for your Date object that tells you what day you were born.

First, you need to instantiate the Date object with the constructor function new Date(). Then you can call on its methods to retrieve specific time information. Table 11.3 summarizes the common methods for retrieving the dates and times.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint