Create the current date in the default time zone.
| (1) |
Extract various components of the object.
Create the current date in the local time zone.
>
|
|
| (5) |
Create a specific date representing 3:42am on July 1, 1967.
>
|
|
| (6) |
How long has it been since that moment?
Midnight (or any moment before 1am) can be specified either as the th hour of one day, or the th hour of the next day.
>
|
|
| (8) |
>
|
|
| (9) |
To compute the length of the Second World War (taken from the invasion of Poland, at 4:45am on Sept. 1, 1939 to the formal surrender of Japan at about 9am on Sept. 2, 1945), construct the Date objects corresponding to the beginning and end events of the war, and subtract.
>
|
|
| (11) |
>
|
|
| (12) |
The result is in milliseconds, since that is the precision of the UTC clock.
| (13) |
Use the convert command with the units option to convert the result to a more convenient form.
>
|
|
>
|
|