We can be sure to keep our users right on time by giving them a running clock that updates every second.
UNIX time, measured in seconds from an arbitrary date in the 1970s, can be difficult to parse out into human-readable time. MooTools makes this much easier in the MooTools MoreDate
class. There are also shortcuts for the parameter that can be passed to Date.get():
ms/Milliseconds
year/FullYear
min/Minutes
mo/Month
sec/Seconds
hr/Hours
The seasoned coder will appreciate that all raw JavaScript date elements are available; MooTools only extends the native class.
Making a clock is a task that comes across our desks perennially.
<script type="text/javascript" src="mootools-1.3.0.js"></script> <!-- we MUST have the MooTools more Date classes --> <script type="text/javascript" src="mootools-more-1.3.0.js"></script> </head> <body> <div id="moo_clock"> <span>0<...