JavaScript Date API Worksheet

Questions

This reference may be helpful in understanding how you can work with Date objects.

Question 1

If you invoke the Date constructor without passing in any parameters, what date will be stored in the object that is returned?

the date of when ever that code was exicuted.

Question 2

What is an 'epoch'?

epoch is basicly day 0 for computers

Question 3

What is a 'Unix timestamp' (also known as 'epoch time')?

how many millisceconds have passes since epoch.

Question 4

What is the actual date of the epoch for Unix timestamps?

jan 1 1970 00:00:00 utc

Question 5

What does the getTime() method of a date object return (refer to the link that was mentioned above, or find another reference on the Date object in JavaScript)?

the epoch timestamp in millisceconds.

Question 6

If you are working with 2 date objects, how could you use the getTime() method to determine if one date is more recent than the other?

wich ever one is bigger. you could subtract them or just compar