Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 563

Lua Scripting • Working with date / time in Lua

$
0
0
I did a little digging, and there is a way to get that [&MeasureName:Timestamp] value into Lua using the SELF: object with a custom option on the Lua script measure
Thank you JS, this is what I needed. The thing is that I'm working with multiple time conversions, from filetime to julian days, then GMST, LST, and so on. And having another layer of conversion is, well, another layer of conversion lol.

Since the skin is working with time in "real time", I decided to just get the timestamp as a global variable instead of inserting it every time on every function. The only thing is that this method returns 0 on first load regardless of if I use it also on the initialize function, and well, it looks "jumpy" at the start. No a big deal though. .... My bad, I had the script measure before the time measure, that's why it was reading 0 on first load :handtohead:

Also, I'm setting the timestamp option on the measure to switch between real time and date input, so when on real time the timestamp option is "nil" but the measure returns the real time timestamp, and when no real time is on then timestamp = another function I made to convert from a date (year month day hour minute second) to timestamp + a variable I'm using to modify the timestamp manually by scrolling, at the same time the measure displays the time formatted on the skin.

This method is good, thank you!

Statistics: Posted by RicardoTM — Yesterday, 7:49 pm — Replies 7 — Views 55378



Viewing all articles
Browse latest Browse all 563

Trending Articles