clock scan "this" modifier 
Author Message
 clock scan "this" modifier

Can anyone explain the usage of the "this" modifier for clock scan?

Should the following not work ?

% info tclversion
8.3
% info patchlevel
8.3.3
% clock format [clock scan "Wednesday last week"]
Wed Aug 21 00:00:00 BST 2002
% clock format [clock scan "Wednesday next week"]
Wed Sep 04 00:00:00 BST 2002
% clock format [clock scan "Wednesday this week"]
unable to convert date-time string "Wednesday this week"
%

Thanks,
Bernhard



Sat, 12 Feb 2005 17:53:45 GMT  
 clock scan "this" modifier

Quote:

> % clock format [clock scan "Wednesday last week"]
> Wed Aug 21 00:00:00 BST 2002
> % clock format [clock scan "Wednesday next week"]
> Wed Sep 04 00:00:00 BST 2002
> % clock format [clock scan "Wednesday this week"]
> unable to convert date-time string "Wednesday this week"

% clock format [clock scan Wednesday]
Wed Aug 28 12:00:00 AM EDT 2002

--
| Don Porter          Mathematical and Computational Sciences Division |

| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|



Sat, 12 Feb 2005 21:38:24 GMT  
 clock scan "this" modifier
Thanks ... but the man page says:

These modifiers may also be specified: tomorrow, yesterday, today, now,
last, this, next, ago.

Could you give an example of usage for the this modifier.

Many Thanks
Bernhard

Quote:


> > % clock format [clock scan "Wednesday last week"]
> > Wed Aug 21 00:00:00 BST 2002
> > % clock format [clock scan "Wednesday next week"]
> > Wed Sep 04 00:00:00 BST 2002
> > % clock format [clock scan "Wednesday this week"]
> > unable to convert date-time string "Wednesday this week"

> % clock format [clock scan Wednesday]
> Wed Aug 28 12:00:00 AM EDT 2002

> --
> | Don Porter          Mathematical and Computational Sciences Division |

> | http://math.nist.gov/~DPorter/                                  NIST |
> |______________________________________________________________________|



Sun, 13 Feb 2005 00:51:24 GMT  
 clock scan "this" modifier
Thanks for the explanation.
Perhaps the man page will be updated.
Quote:

> No, because it doesn't work. (Tcl 8.3.4)

> It's a bug in tclGetDate.y. "this" and "now" should be identical, but
> "this" doesn't work because it ends in 's', and the 's' is stripped off
> to handle possible plural units (years vs year). After it fails to
> match a unit, the 's' doesn't get put back, so it tries to match 'thi'
> against the table of other words (OtherTable) and fails. Oops.

> But using "now" does whatever "this" was supposed to do, which isn't much.
>     % clock format [clock scan "now -1 week"]
>     Tue Aug 20 22:34:19 EDT 2002
>     % clock format [clock scan "-1 week"]
>     Tue Aug 20 22:34:26 EDT 2002

> Speaking of clock scan oddities, isn't this great?
>        % clock format [clock scan "stardate 56123.1"]
>        Thu Feb 14 02:24:00 EST 2002



Sun, 13 Feb 2005 18:41:17 GMT  
 clock scan "this" modifier

Quote:

> Speaking of clock scan oddities, isn't this great?
>        % clock format [clock scan "stardate 56123.1"]
>        Thu Feb 14 02:24:00 EST 2002

If I remember all the useful suggestions that have been declined
in the past, I find it really odd, that such a thing went in.

Was there a TIP for it ?

--
Newsflash: Sproingy made it to the ground !
  read more ... <http://avl.enemy.org/sproingy/>



Sun, 13 Feb 2005 22:12:53 GMT  
 clock scan "this" modifier

Quote:
>>        % clock format [clock scan "stardate 56123.1"]

> Was there a TIP for it ?

That was added long before TIPs, or even the TCT.

--
| Don Porter          Mathematical and Computational Sciences Division |

| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|



Sun, 13 Feb 2005 22:19:56 GMT  
 clock scan "this" modifier

    >>> % clock format [clock scan "stardate 56123.1"]

    >> Was there a TIP for it ?

    Don> That was added long before TIPs, or even the TCT.

Yeah, but it is useless for real stardates; I mean it won't get past
2038....

roland
--
                       PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD                             RL Enterprises




Sun, 13 Feb 2005 23:49:48 GMT  
 clock scan "this" modifier

Quote:

> >>        % clock format [clock scan "stardate 56123.1"]


> > Was there a TIP for it ?

> That was added long before TIPs, or even the TCT.

See also the %Q format specifier for [clock format]

        % clock format  [clock seconds] -format %Q
        Stardate 56657.3

--
Sincerely,

        Join us in Sept. for Tcl'2002: http://www.tcl.tk/community/tcl2002/
        ** Registration is open **


        Private         <http://www.purl.org/NET/akupries/>
-------------------------------------------------------------------------------

Quote:
}



Mon, 14 Feb 2005 08:06:29 GMT  
 clock scan "this" modifier


:It's a bug in tclGetDate.y.

Sounds like a bug that should be reported to http://tcl.sf.net/ - has
it been reported yet?
--
Tcl'2002 Sept 16, 2002, Vancouver, BC http://www.tcl.tk/community/tcl2002/
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.



Wed, 16 Feb 2005 01:46:24 GMT  
 clock scan "this" modifier

Quote:


> :It's a bug in tclGetDate.y.

> Sounds like a bug that should be reported to http://tcl.sf.net/ - has
> it been reported yet?

Yes.
https://sourceforge.net/tracker/?func=detail&aid=600832&group_id=1089...

--
Glenn Jackman



Wed, 16 Feb 2005 02:25:51 GMT  
 clock scan "this" modifier

Quote:

> Speaking of clock scan oddities, isn't this great?
>       % clock format [clock scan "stardate 56123.1"]
>       Thu Feb 14 02:24:00 EST 2002

Good lord, that's nice! What is the basis for calculating that? Even
trekkies have difficulties agreeing on what stardates really mean...

--
                              / http://www.fishpool.com/~setok/



Sat, 19 Feb 2005 00:18:14 GMT  
 clock scan "this" modifier

Quote:


>>Speaking of clock scan oddities, isn't this great?
>>      % clock format [clock scan "stardate 56123.1"]
>>      Thu Feb 14 02:24:00 EST 2002

> Good lord, that's nice! What is the basis for calculating that? Even
> trekkies have difficulties agreeing on what stardates really mean...

If you look in the code, we clearly stated the source for the stardate
calculation.  We did a bit of research first to make sure that noone would
fault Tcl's stardate functionality.  ;)

--
     Jeff Hobbs                     The Tcl Guy
     Senior Developer               http://www.ActiveState.com/
         Tcl Support and Productivity Solutions
  Join us in Sept. for Tcl'2002: http://www.tcl.tk/community/tcl2002/



Sat, 19 Feb 2005 12:26:57 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. BUG in "clock scan"

2. Problem clock scan "ccyymmdd hhmm" when hh="00"

3. "info hostname" "clock scan" bug on HPUX 10.10

4. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

5. clock scan [clock format [clock seconds]] fails

6. scan string for "returns"

7. binary scan: "character string"?

8. scan for "words" in Reference Manual

9. incorrect return value for "scan" command

10. Problem with "scan" command in tcl

11. BUG:clock format [clock scan "12:00 -10 Min"]

12. 100% Digital Method of "Clock Recovery"

 

 
Powered by phpBB® Forum Software