Closed Bat1963 closed 7 months ago
Hello, I can get the current time in seconds as below:
timenow=window:Date() hours=tonumber(timenow:sub(17,18)) mins=tonumber(timenow:sub(20,21)) secs=tonumber(timenow:sub(23,24)) starttime=hours*60*60+mins*60+secs
I can't seem to get the js getTime() or Date.now() things to work though. Basically, I was wondering if there is a way to do this through javascript. I actually don't need milliseconds, but I might in future!
Are you looking for js.new(js.global.Date)?
js.new(js.global.Date)
i.e. you want the equivalent of JS's new Date(), not Date() which is what you're doing
new Date()
Date()
Hello, I can get the current time in seconds as below:
I can't seem to get the js getTime() or Date.now() things to work though. Basically, I was wondering if there is a way to do this through javascript. I actually don't need milliseconds, but I might in future!