Fingercomp 37 Posted October 24, 2015 Share Posted October 24, 2015 Long time ago I wrote a small program. It displays in-game time and real-life time. Pastebin: pastebin get aKjh5SZL clock.lua By default, touching the screen switches mode (from RL to in-game and vise versa). There are also some settings to play with. MT_BG = 0x000000 -- In-game Time (MT) mode background color. MT_FG = 0xFFFFFF -- MT mode foreground color. DAY = 0xFFFF00 -- "Day" | EVENING = 0x202080 -- "Evening" | String NIGHT = 0x000080 -- "Night" | colors MORNING = 0x404000 -- "Morning" | RT_BG = 0x000000 -- Real-life Time (RT) Mode background color. RT_FG = 0xFFFFFF -- RT mode foreground color. TIMEZONE = 0 -- Set TZ to make program display your local time. -- Example values: -6, 2.5, 12. CORRECT = 0 -- Some TZ correction. Needs if host TZ is not UTC, or time gets messed up again. W, H = 40, 8 -- Width and height of screen in "pixels". REDSTONE = false -- Enable/disable redstone mode switching behaviour. TOUCH = true -- Same as this (↑). But for screen touching. KEY1 = 13 -- Make program stop when key pressed ([Enter] by default). KEY2 = 28 -- ↑ SHOWSECS = true -- Shows seconds in RT mode if value is true. AUTOMODE = true -- Controls which mode will be chosen on program start. -- MT = true -- RT = false SWDATEMT = true -- Shows date line in MT mode if value is true. SWDATERT = true -- Shows date line in RT mode if value is true. SWDTMMT = true -- Shows time of day line in MT mode if value is true. SWDTMRT = true -- Same as this (↑). But for RT mode. Quote Link to post Share on other sites
jhagrid77 4 Posted October 24, 2015 Share Posted October 24, 2015 Seems pretty good, although might need some fixing of the time zones, it was an hour behind for me. Quote Link to post Share on other sites
Fingercomp 37 Posted October 24, 2015 Author Share Posted October 24, 2015 Seems pretty good, although might need some fixing of the time zones, it was an hour behind for me. Time is completely messed up. But, yeah, some changes to the code are required. *** New CORRECT setting makes possible to do some tweaking with time zones. Quote Link to post Share on other sites
lovecomputers 0 Posted October 25, 2015 Share Posted October 25, 2015 Works well for me! Quote Link to post Share on other sites
ishfwilf 0 Posted June 18, 2017 Share Posted June 18, 2017 step by step to fix timezone? Quote Link to post Share on other sites
Fingercomp 37 Posted June 18, 2017 Author Share Posted June 18, 2017 Start the program. Switch to RT mode (i.e. click on the screen). Calculate the difference between the time displayed on the screen, and the real UTC time, in hours (for example, -1 means the real time is 1 hour behind the time shown). Open the program (edit programname.lua) and go to line 10, the one that starts with "CORRECT =". Replace 0 with the difference you've calculated in step 3. On the previous line, replace 0 with the timezone you want (sample values: -6, +3, -10, +11). Save the file (Ctrl+S) and quit (Ctrl+W). Restart the program. Quote Link to post Share on other sites