Oxoscript turns into NanoPy - more infos

Time functions

stopInterval

  stopInterval()

Stops the timer previously set with setInterval().

setInterval

  setInterval(ms:long)

Calls the onTimer() event repeatedly after ms milliseconds.

print("Print Hello every 3 seconds...")
setInterval(3000)

def onTimer():
    print("Hello")

stopTimer

  stopTimer()

Stops the timer previously set with setTimer().

setTimer

  setTimer(ms:long)

Calls the onTimer() event once after ms milliseconds.

print("Print Hello in 3 seconds...")
setTimer(3000)

def onTimer():
    print("Hello")

getEpoch

  getEpoch()->long

Returns the current Epoch Unix timestamp or the one set with setEpoch().

This value is the number of seconds since January 1, 1970 at 00:00.

getEpoch() # => 1582226420

setEpoch

  setEpoch(epoch:long)

Overwrites the time information retrieved from the Internet with a user-defined time information (Epoch Unix Timestamp).

setEpoch(1582226420)

getMillis

  getMillis()->int

Returns the current millisecond.

ms = getMillis()

getSecond

  getSecond()->int

Returns the current second or the second set with setTime().

s = getSecond()

getMinute

  getMinute()->int

Returns the current minute or the minute set with setTime().

m = getMinute()

getWeekDay

  getWeekDay()->int

Returns the current day of the week.

0 = Sunday 1 = Monday 2 = Tuesday 3 = Wednesday 4 = Thursday 5 = Friday 6 = Saturday

wd = getWeekDay()

getHour

  getHour()->int

Returns the current hour or the hour set with setTime().

h = getHour()

getDay

  getDay()->int

Returns the current day or the day set with setDate().

d = getDay()

getMonth

  getMonth()->int

Returns the current month or the month set with setDate().

m = getMonth()

getYear

  getYear()->int

Returns the current year or the year set with setDate().

y = getYear()

setDate

  setDate(d:int,m:int,y:int)

Overwrites the date retrieved from the Internet with a user-defined date.

d = day m = month y = year

setDate(31,12,1990)

setTime

  setTime(h:int,m:int,s:int)

Overwrites the time retrieved from the Internet with a user-defined time.

h = hour m = minute s = second

setTime(23,59,55)

setTimeZone

  setTimeZone(tz:byte[])

Sets the time zone to be used for the time functions.

You can find all available time zones here

setTimeZone("CET-1CEST,M3.5.0,M10.5.0/3") # Europe/Zurich

delay

  delay(ms:long)

Pauses execution by ms milliseconds.

millis

  millis()->long

Returns the milliseconds since the last start of the Oxocard. Since the data type “long” has a limited memory size, an overflow occurs for approx. 49.71 days and millis() starts again at 0.