The script I use, stores nicks with date and time in mysql db
The row, thats stores date now, is called addtime:
Made it like this: 'addtime datetime'
This row stores datetime like this
2007-01-17 20:11:43
The script uses:
Code: Select all
set data [mysqlsel $db "select *,SEC_TO_TIME(unix_timestamp(now()) - unix_timestamp(pretime)) as data from $table WHERE nick like '%$keyed%' GROUP BY data;" -list]
This will result in a output in hours, minutes and seconds. Example: 65:57:17
So the output looks someting like this:
In the earlier post (http://forum.egghelp.org/viewtopic.php?t=12983) i asked to change the time output (65:57:17) to seconds, minutes, hours, days etcDATA -> NICK {2007-01-17 20:11:43} 65:57:17
Code: Select all
proc fixTime {daTime} {
foreach {h m s} [split $daTime :] {
set unixt [clock scan "$h hours $m minutes $s seconds ago"]
break
}
duration [expr {[unixtime]-$unixt}]
}
So everyting works greatNICK - Added 2 days 17 hours 57 minutes 7 seconds ago
But now the problem:
When a nick is added longer then about 4 weeks 6 days 22 hour 59 minutes and 59 seconds ago (838:59:59), it keeps announcing 4 weeks 6 days 22 hour 59 minutes and 59 seconds (838:59:59) even if the nick is added longer then that time ago.
data Examples:
So the addtime is correct, but the calculated time between addtime and now time isnt, it keep telling its 838:59:59 (?)DATA -> nick1 {2006-11-19 18:46:13} 838:59:59
DATA -> nick2 {2006-11-22 01:59:23} 838:59:59
DATA -> nick3 {2006-11-27 09:22:19} 838:59:59
Any idea what could be the problem?
Thanks