Is this module available for Puck.js ? I tried this code and it says module "clock" not found.
Did you upload using the right-hand side of the IDE? The
clockmodule needs to be loaded off the net, so it has to be uploaded first via the right-hand side so the IDE can detect its use and upload it.
However, you may find that the
Dateclass does everything that you need all by itself? http://www.espruino.com/Reference#Date
You can turn on
Set Current Timein the Web IDE so that it will automatically set the correct time whenever you upload code.
From above ...
var clk=new Clock(2014,4,15,23,45,0,0); // Initialise with specific date
print(d1.toString()); // prints "Thu May 15 2014 23:45:05"
It does what it says BUT the number "4" for the month is April and 5 should be for May.
Looks like someone started to use, for the months, 0-11 and not the normal 1-12?
Are you going to keep the months index this way?
Windows 8.1 64 Bit
Chrome 35.0.1916.153 m (no beta)
Web-IDE v 45
Board: Espruino v 1.3