Re: [clock scan] behaves inconsistently in Tcl8.5 (was: Re: [clock scan day] behaves differentyl in Tcl8.5 than in Tcl8.4)



Ronnie Brunner wrote:
> % clock format [clock scan "now - 1 days"]
> Sun Aug 28 00:00:00 +0200 2005
> % clock format [clock scan "now + 0 days"]
> Mon Aug 29 19:52:33 +0200 2005
> % clock format [clock scan "now + 1 days"]
> Tue Aug 30 00:00:00 +0200 2005
> -> "now + 0 days" is not consistent with "now +/- 1 days"
>
> Is there any reason for this?

The author of the [clock] changes should answer in the next few days
about the precise rationale, but until then, note the new [clock add]
command that's the recommended way to do things like above with Tcl 8.5.

% clock format [clock seconds]
Mon Aug 29 14:43:08 -0400 2005
% clock format [clock add [clock seconds] +1 day]
Tue Aug 30 14:43:27 -0400 2005
% clock format [clock add [clock seconds] -1 day]
Sun Aug 28 14:43:43 -0400 2005
% clock format [clock add [clock seconds] +0 day]
Mon Aug 29 14:43:55 -0400 2005

[clock add] understands subtleties like how adding "1 day" is different
from adding "24 hours".

--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.



Relevant Pages

  • Re: Terrabites of storage
    ... one half of the clock, ... peripherals, a couple K of memory, and the aforementioned flash block. ... which is another reason there aren't any 6502-derived chips ... [neep neep neep. ...
    (rec.arts.sf.composition)
  • Re: [PATCH] fix for sched_clock() when using jiffies
    ... I presume it's just gone unnoticed because nobody actually uses this ... I can confirm for our ARM port that if I revert to using this default ... Unless there is some other reason for having this one implementation ... regardless of the underlying clock values. ...
    (Linux-Kernel)
  • Re: Missed goal
    ... or cancelled shows following games. ... be broken for some reason. ... The clock does not stop during play. ... But the thing about American football is it's played so late at night, ...
    (rec.arts.sf.fandom)
  • Re: Beam me up - trying to get a basic understanding of GR
    ... Philosophy is not the only discipline reliant on logic and its foundations - ... I spoke of time dilation in appearance only. ... In physics time is defined as what a clock reads. ... reason for that. ...
    (sci.physics.relativity)
  • Re: Missed goal
    ... or cancelled shows following games. ... be broken for some reason. ... The clock does not stop during play. ... But the thing about American football is it's played so late at night, ...
    (rec.arts.sf.fandom)