Login
7 branches 0 tags
Ben (Mac) Self compiled runtime now passes all Tests! cb7bf42 4 years ago 58 Commits
nujel / stdlib / time.nuj
; Time related λs

; Initialize the RNG
[random-seed [logxor [time] [time/millliseconds]]]

[def time/seconds [λ [timestamp]
	"Return the seconds part of TIMESTAMP, defaults to current time"
	[% [default timestamp [time]] 60]
]]

[def time/minutes [λ [timestamp]
	"Return the minutes part of TIMESTAMP, defaults to current time"
	[% [/ [default timestamp [time]] 60] 60]
]]

[def time/hours [λ [timestamp]
	"Return the hours part of TIMESTAMP, defaults to current time"
	[% [/ [default timestamp [time]] 3600] 24]
]]