Well, you can set time with the Web IDE - in fact that tutorial says:
First step is to go into the Web IDE's settings (top right icon), then click Communications, then scroll down and make sure that Set Current Time is checked. Then the next time you send code to the Espruino board, the Web IDE will automatically set up its RTC.
But also simply using the setTime command from the console works too (seconds since 1970 as a number) - it's what the Web IDE does behind the scenes.
The main thing you need to get the time is getTime(), which returns seconds since 1970 (or by default in the original Espruino board, seconds since startup).
Then you can initialise the Date class if you need to get more specific information about the time.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Well, you can set time with the Web IDE - in fact that tutorial says:
But also simply using the
setTime
command from the console works too (seconds since 1970 as a number) - it's what the Web IDE does behind the scenes.The main thing you need to get the time is
getTime()
, which returns seconds since 1970 (or by default in the original Espruino board, seconds since startup).Then you can initialise the Date class if you need to get more specific information about the time.