Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Timer
- min = min + 1;
- if min == 60 then
- min = 0;
- hr = hr + 1;
- if hr == 24 then
- hr = 0;
- end
- end
- --Script
- function write_time()
- local s;
- local shr;
- local smin;
- local sdot;
- if hr <= 12 then
- sdot = "am";
- shr = hr;
- else
- sdot = "pm";
- shr = hr - 12;
- end
- if min < 10 then
- smin = "0" .. min;
- else
- smin = min;
- end
- s = "Time is " .. shr .. ":" .. smin .. " " .. dot;
- return s;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement