Code: Select all
if {[catch {set from [clock scan $date]} {
# error code
} else {
# remainder of code
}
My Eggdrop running Tcl 8.5 functions as I expected. Using similar code in the partyline yields :-
[20:12] <arfer> .tcl set from [clock scan 13/33/10]
[20:12] <Baal> Tcl error: unable to convert date-time string "13/33/10"
My Windrop running Tcl 8.4 does not function as expected, yielding the following in the partyline :-
[20:11] <arfer> .tcl set from [clock scan 13/33/10]
[20:11] <osmosis> Tcl: 1296604800
I'm not sure if this a Tcl version issue or a Windows/Linux date/time issue or even a geographical issue or a combination thereof.
In any event, what (hopefully simplistic) code is recommended for validating dates that functions as expected irrespective of the bot type, Tcl version, operating system or geography.