<i>year int overflow - clock format of very large date / JD is wrong - if switches into negative value (+24 hours difference).</i> status still Open with 4 other changes
by
.
D 2019-01-23T17:11:24.982
J icomment I\sfound\sstill\sanother\ssimilar\sissue\s(because\sminor,\swon't\sopen\snew\sticket):\r\n<pre\sstyle="padding-left:10pt">\r\n\s\s%\sclock\sformat\s[expr\s{-210866803200\s-\s0}]\s-format\s{%J\s--\s%Y-%m-%d\s%T}\s-gmt\strue\r\n\s\s0000000\s--\s4713-01-01\s00:00:00\r\n\s\s%\sclock\sformat\s[expr\s{-210866803200\s-\s1}]\s-format\s{%J\s--\s%Y-%m-%d\s%T}\s-gmt\strue\r\n<b\sstyle="color:red">-\s0000000\s--\s4713-01-01\s23:59:59</b>\r\n<b\sstyle="color:green">+\s-000001\s--\s4714-12-31\s23:59:59</b>\r\n\s\s%\sclock\sformat\s[expr\s{-210866803200\s-\s86400}]\s-format\s{%J\s--\s%Y-%m-%d\s%T}\s-gmt\strue\r\n<b\sstyle="color:red">-\s-000001\s--\s4714-12-31\s00:00:00</b>\r\n<b\sstyle="color:green">+\s-000002\s--\s4714-12-31\s00:00:00</b>\r\n</pre>\r\n\r\nJulian\sday,\sif\straverses\sover\s0\sinto\snegative\s(from\syear\s4713\sB.C.E\sto\s4714\sB.C.E),\sbecomes\snegative\svalue\sfirst\sif\sit\sis\sswitched\sa\scomplete\sday\sback\s(24\shours\sare\sinvalid).<br/>\r\nBecause\sjulian\sday\sused\salso\sin\sthe\sinternal\scalculations,\sas\sone\scan\ssee\sin\sthe\ssecond\scall\s(red-marked\sresult),\sthe\sformated\sdate\sis\stherefore\stotally\swrong.\sExpected\svalue\sis\sgreen-marked.\r\n\r\nThere\sare\s2\svariants\sto\sfix\sthis:<br/>\r\n1.\sJD\sto\s-1,\sand\sseconds\sof\sday\sto\s86399\s(simplest\scase\sto\simplement\sor\sto\sfix\sit)<br/>\r\n2.\sJD\sto\s0,\sand\sseconds\sof\sday\sto\s-1\s(more\scomplex\scase,\sbecause\sat\sthe\smoment\svalue\sof\sday-seconds\sis\srather\spositive\severywhere\sin\sinternal\scalculations,\sthus\sthen\smany\sadjustments\sare\snecessary\sin\sthis\scase).\r\n\r\nI've\sfixed\sit\s(variant\s1)\sin\smy\sinternal\sbranches\s(and\stclclockmod),\swill\sport\sit\slater\sin\ssebres-8-6-clock-speedup\sbranch.\r\n\r\nBTW,\sI\sdon't\sunderstand\salso,\swhy\sit\shas\spadding\s7\sat\sall\s(and\sfor\swhich\sreasons\sit\smay\sbe\snecessary).
J login sebres
J mimetype text/x-fossil-wiki
J title year\sint\soverflow\s-\sclock\sformat\sof\svery\slarge\sdate\s/\sJD\sis\swrong\s-\sif\sswitches\sinto\snegative\svalue\s(+24\shours\sdifference).
K 16e4fc30961de5dc969639eaef7354022b683102
U sebres
Z ded4f18405e78a3b7068e52d07f45dec