Re: [clock scan] behaves inconsistently in Tcl8.5 (was: Re: [clock scan day] behaves differentyl in Tcl8.5 than in Tcl8.4)
- From: Don Porter <dgp@xxxxxxxxxxxxxx>
- Date: 29 Aug 2005 18:45:50 GMT
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 |
|______________________________________________________________________|
.
- Follow-Ups:
- References:
- [clock scan day] behaves differently in Tcl8.5 than in Tcl8.4
- From: Ronnie Brunner
- Re: [clock scan day] behaves differently in Tcl8.5 than in Tcl8.4
- From: Don Porter
- [clock scan] behaves inconsistently in Tcl8.5 (was: Re: [clock scan day] behaves differentyl in Tcl8.5 than in Tcl8.4)
- From: Ronnie Brunner
- [clock scan day] behaves differently in Tcl8.5 than in Tcl8.4
- Prev by Date: [clock scan] behaves inconsistently in Tcl8.5 (was: Re: [clock scan day] behaves differentyl in Tcl8.5 than in Tcl8.4)
- Next by Date: Re: future support for rivet?
- Previous by thread: [clock scan] behaves inconsistently in Tcl8.5 (was: Re: [clock scan day] behaves differentyl in Tcl8.5 than in Tcl8.4)
- Next by thread: [clock] behaves just slow (Re: [clock scan] behaves inconsistently in Tcl8.5 (was: Re: [clock scan day] behaves differentyl in Tcl8.5 than in Tcl8.4))
- Index(es):
Relevant Pages
|