.
D 2024-07-15T09:47:57.777
J assignee nobody
J closer nobody
J cmimetype text/x-markdown
J comment In\smy\scode,\sI\sfrequently\suse\sthe\sfollowing\smethod\sto\sget\sthe\sepoch\stime\sof\sthe\snext\smidnight:\r\n\r\n\tset\smidnight\s[clock\sscan\s24:00:00\s-format\s%T]\r\n\r\nIn\sTcl\s9.0\sthat\scurrently\sthrows\san\serror.\sApparently\sI\sneed\sto\suse\sthe\soption\s-validate\s0\sto\sallow\sthe\sTcl\s8.6\sbehavior.\r\n\r\nFirst\sof\sall,\sthere\sis\sno\smention\sof\sthe\s-validate\soption\sin\sthe\sclock\smanual\spage.\s[TIP\s#688](https://core.tcl-lang.org/tips/doc/trunk/tip/688.md)\sclaims\sthat\sthe\sdefault\svalue\sfor\sthe\s-validate\soption\sis\s0.\sIn\spractice\sit\sseems\sto\sactually\sbe\s1.\r\n\r\nHowever,\sthe\sbiggest\sproblem\sis\sthat\sthe\sproduced\svalue\sis\sincorrect.\sClearly\s24:00:00\sshould\sbe\s1\ssecond\safter\s23:59:59.\sBut\sthat\sis\snot\sthe\scase.\sI\swrote\sthe\sfollowing\stest\sscript:\r\n\r\n\tif\s{[package\svsatisfies\s[package\spresent\sTcl]\s9]}\s{\r\n\t\s\s\s\sset\snovalidate\s{-validate\s0}\r\n\t}\selse\s{\r\n\t\s\s\s\sset\snovalidate\s{}\r\n\t}\r\n\r\n\tset\ssec1\s[clock\sscan\s23:59:59\s-format\s%T\s{*}$novalidate]\r\n\tset\ssec2\s[clock\sscan\s24:00:00\s-format\s%T\s{*}$novalidate]\r\n\r\n\tputs\s[expr\s{$sec2\s-\s$sec1}]\r\n\r\nIn\sTcl\s8.6\sthis\sproduces\sa\sresult\sof\s1,\sas\sexpected.\sIn\sTcl\s9.0\sit\sreports\s-86400\s(possibly\sdepending\son\sthe\sday\sof\sthe\sweek\sthe\sscript\sis\sexecuted).
J foundin 3d8bf31bdc
J is_private 0
J login sbron
J priority 5\sMedium
J private_contact 8475f421649231f1e116ac602bea4537d2b027b4
J resolution None
J severity Critical
J status Open
J submitter sbron
J subsystem 16.\sCommands\sA-H
J title Clock\sscan\sissues\swith\svalidation\sdisabled.
J type Bug
K 3ee8f1c2a785f4d8bd0ca60f1076cee78ebb3255
U sbron
Z 81ae512f5fdc90d5ab43b503b64274f8