For Programmers: Free Programming Magazines  


Home > Archive > Tcl > January 2008 > clock scan









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author clock scan
Matthias Meier

2008-01-30, 7:46 pm

Hello,

today is Wednesday the 30.01.2008.

% clock format [clock scan "Monday last W"] -format "%d.%m.%Y"
28.01.2008

?? shouldn't it be 21.01.2008


% clock format [clock scan "Monday next W"] -format "%d.%m.%Y"
11.02.2008

?? shouldn't ist be 04.02.2008

% clock format [clock scan "Monday this W"] -format "%d.%m.%Y"
unable to convert date-time string "Monday this W"

?? shouldn't ist be 28.01.2008


How do i get the date of Sunday/Monday/Tuesday.. in the actual W?


Thanks,
Matthias


(Same results with 8.4.11 and 8.5.0)
suchenwi

2008-01-31, 4:53 am

Looks like just a wday is understood as near future:

125 % clock format [clock scan "Monday"]
Mon Feb 04 00:00:00 W. Europe Standard Time 2008

if not the current day:
130 % clock format [clock scan "Thursday"]
Thu Jan 31 00:00:00 W. Europe Standard Time 2008

So if you shift it, "last w" or "1 w ago":

135 % clock format [clock scan "Monday 1 w ago"]
Mon Jan 28 00:00:00 W. Europe Standard Time 2008



John Mercogliano

2008-01-31, 7:49 pm

On Jan 31, 3:54=A0am, suchenwi <richard.suchenwirth-
bauersa...@siemens.com> wrote:
> Looks like just a wday is understood as near future:
>
> 125 % clock format [clock scan "Monday"]
> Mon Feb 04 00:00:00 W. Europe Standard Time 2008
>
> if not the current day:
> 130 % clock format [clock scan "Thursday"]
> Thu Jan 31 00:00:00 W. Europe Standard Time 2008
>
> So if you shift it, "last w" or "1 w ago":
>
> 135 % clock format [clock scan "Monday 1 w ago"]
> Mon Jan 28 00:00:00 W. Europe Standard Time 2008


Matthias,
I ran into the same senario when I needed a Sunday date, I used
the following command:
clock format [clock scan "Sunday last w" -base [clock scan
"saturday last w"]]

John
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com