Here goes:
Nicks are stored in a mysql database with the time the nick is added (datetime) like: 2007-19-01 20:01:02 (row is called "addtime")
To find how long ago the nick was stored the script use the folowing:
Code: Select all
set temp [mysqlsel $db "select *,SEC_TO_TIME(unix_timestamp(now()) - unix_timestamp(addtime)) as data from table WHERE .....
Now it returns someting like:
nick added to the db 17:50:57 ago
nick added to the db 25:50:57 ago
nick added to the db 339:50:57 ago
etc.
Im trying it will return the time after 24:00:00 like 1day 1hour 50min and 57 sec ago.
Same with weeks ,months, years
Any idea what i can add to the script to let it announce like this?
Thanks.