Manfred Stelzhammer <
[email protected]> wrote:
Hi
Why don't get an error:
clock format [clock scan 2023-22-35 -format %Y-%m-%d] -format "%Y-%m-%d"
2023-22-35 isn't a guilty date.
I get: 2024-11-04
The Tcl 8.6 (you didn't say which Tcl, but this behaviour came about in
8.6) effectively performs a "modulo" on the month and on the day to
produce a "what you must have meant" result instead of reporting an
"invaid date" error.
22 modulo 12 is 10.
35 modulo 31 (month 10 has 31 days) is 4
so you get "11-04" out (10 plus a month for the 31 days in 35).
Personally I'd have preferred an "invalid date" error.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)