Skip to content
Tcl Source Code Artifact [2c563bd975]
Login

Artifact [2c563bd975]

Artifact 2c563bd9756f7df45f5289405f234b361b9b2e1f:

Ticket change [2c563bd975] - Ticket [2882209fffffffff|2882209fff] <i>clock scan error</i> status still Open with 4 other changes by kennykb on 2009-10-29 07:40:20.
D 2009-10-29T07:40:20
J icomment This\sis\san\sexample\sof\swhy\s[clock\sscan]\swithout\sa\s'-format'\sis\sso\svery\snasty.\n\nWhen\syou\sdo\s[clock\sformat\s[clock\sscan\s"[clock\sformat\s$start]\s+\s1\sday"]],\swhat\sthat\swinds\sup\sasking\s[clock\sscan]\sto\sparse\sis\sthe\sstring:\n\nSun\sOct\s25\s23:00:00\sCEST\s2009\s+\s1\sday\n\nAll\sgoes\swell\swith\sparsing,\sand\swe\sget:\n\nyear\s2009\smonth\s10\sday\s25\stime\sof\sday\s00:00:00\s+\s1\sday\stimezone\sCEST\n\nAdjusting\sthe\sdate\sby\s1\sday\sgives\n\nyear\s2009\smonth\s10\sday\s26\stime\sof\sday\s00:00:00\stimezone\sCEST\n\nAnd\s-\sCEST\sis\sstill\sin\seffect\shere-\sbecause\sit's\sspecified\sexplicitly\sas\sthe\stimezone!\nSo\seven\sthough\sthe\sspecified\stime\sis\safter\sthe\sSummer\sTime->Standard\sTime\sconversion,\sit's\sinterpreted\sin\sSummer\sTime\sand\sresults\sin\sa\stime\sthat's\san\shour\soff.\n\nBut\sif\swe\stry\sto\sfix\sthis,\sit\swould\sbreak\sthe\scase\swhere\swe\shave\san\sinput\sstring\swith\sa\stimezone\sother\sthan\sthe\ssystem\stimezone:\n\nSun\sOct\s25\s00:00:00\sEDT\s2009\n\nAs\sI\smentioned\searlier,\s[clock\sadd]\swill\swork.\s\sIf\syou\sneed\s8.4\scompatibility,\sprobably\sthe\sbest\soption\sis:\n\nclock\sformat\s[clock\sscan\s{+1\sday}\s-base\s$start]\n\nwhich\salso\sgets\sthe\sright\sanswer,\sand\sis\sshorter\sand\ssimpler\sthan\swhat\syou've\stried.\n\nAlso,\susing\sany\sformat\swithout\sa\stimezone\sin\sthe\sinner\s[clock\sformat]\sworks.\n\n%\sclock\sformat\s[clock\sscan\s"+1\sday"\s-base\s$start]\nMon\sOct\s26\s00:00:00\sCET\s2009\n%\sclock\sformat\s[clock\sscan\s"[clock\sformat\s$start\s-format\s{%Y-%m-%d\s%H:%M:%S}]\s+1\sday"]\nMon\sOct\s26\s00:00:00\sCET\s2009\n
J login kennykb
J mimetype text/plain
J username kennykb
K 2882209fffffffffffffffffffffffffffffffff
U kennykb
Z e999e33777b8e58e0a4b8c8e9a73f318