View Single Post
07-27-13, 01:43 PM   #18
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,906
Personally I've found it quite handy to use Discord Art to do this sort of thing but I'm already using it for other things as well.

Anyway Akatosh if you decide to proceed with KgPanels here's the code for a clock.

Code:
local minutes, hour, minute
local t = date("*t", time())
hour = t.hour
minute = t.min
minutes = (hour*60) + minute
if (minutes > 1440) then
    minutes = minutes - 1440
end
minutes = abs(minutes)
hour = floor(minutes/60)
minute = format("%02d", mod(minutes, 60))
local text
if minutes > 719 then
    if minutes > 779 then
        hour = floor(minutes/60) - 12
    end
    text = hour .. ":" .. minute .. " pm"
else
    if (hour == 0) then
        hour = 12
    end
    text = hour .. ":" .. minute .. " am"
end
-- do whatever KgPanels uses to update the display with text.
About the only thing that would be difficult would be the memory usage.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 07-27-13 at 02:17 PM.
  Reply With Quote