If your date is not showing correct add this to the clock function in :
function showclock()
dato = date()
_,_,mm,dd,yy,ttt,mmm = strfind(dato, "(%d+)/(%d+)/(%d+)%s(%d+):(%d+)")
local ddd = date("%A")
mm = tonumber(mm)
dd = tonumber(dd)
if dd == 1 or dd == 21 or dd == 31 then
suf = "st"
elseif dd == 2 or dd == 22 then
suf = "nd"
elseif dd == 3 or dd == 23 then
suf = "rd"
else
suf = "th"
end
.......................................................................
function dotime(user,data)
dato = date()
_,_,mm,dd,yy,ttt,mmm = strfind(dato, "(%d+)/(%d+)/(%d+)%s(%d+):(%d+)")
local ddd = date("%A")
mm = tonumber(mm)
dd = tonumber(dd)
if dd == 1 or dd == 21 or dd == 31 then
suf = "st"
elseif dd == 2 or dd == 22 then
suf = "nd"
elseif dd == 3 or dd == 23 then
suf = "rd"
else
suf = "th"
end
......................................................................
This will sort your date out
Green Greetz To All
Big Hi to MAster @ Magmar
I was dipping into the Mean_Machine by Snowman and I came across this func ...
I would like to know what would cause the date not to display propertly ..
I cant seem of a logical excuse ...
I use this script that shows the time in main and it shows the correct time. Because the time on the message it sends it times, is the same as the time stamp in DC. So maybe it isn't always wrong with how the script checks the time.
-- TimeBot by aMutex - 30.12.2002
BotName = #Clock"
TimeSpanInMinutes = 180
function Main()
SetTimer(TimeSpanInMinutes*60000)
StartTimer()
end
function OnTimer()
SendToAll(BotName, date("The time is %T in our hub local timezone."))
end
Sure ... I'm cool with that ...
I still don't get it .. why would the date AND the time display "not show correct"? (as it is stated in this first post )
QuoteOriginally posted by Herodes
Sure ... I'm cool with that ...
I still don't get it .. why would the date AND the time display "not show correct"? (as it is stated in this first post )
the only posible bug i know in this comes from the fact some ppl use the date() wrong.
many use time = date("%H")..:..date("%M").."."..date("%S").
but this can go wrong, best explained with an example.
it's 11:59.99 when you do date("%H"), this retrieves 11.
next the date("%M") is triggered, which should retrieve 59.
but if the time changed it can return 00.
the result is that time becomes 11:00, now thats an hour 2 late.
plop
Hehe :D
thank u plop ... it was a sneaky one ...
this is what "experience" and "clear thinking" is all about ...
now it is definately clear...