Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The computing field is always in need of new cliches. -- Alan Perlis


devel / comp.lang.tcl / Re: Problem with clock scan

SubjectAuthor
* Problem with clock scangreg
`* Problem with clock scangreg
 `* Problem with clock scanAlan Grunwald
  `- Problem with clock scangreg

1
Problem with clock scan

<b2bc76a6-e3a0-4579-b569-93f1219903cdn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12578&group=comp.lang.tcl#12578

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:e9c1:0:b0:67e:fd55:eef0 with SMTP id q1-20020a0ce9c1000000b0067efd55eef0mr37369qvo.7.1702600473487;
Thu, 14 Dec 2023 16:34:33 -0800 (PST)
X-Received: by 2002:a17:90b:4a86:b0:28b:1848:aabe with SMTP id
lp6-20020a17090b4a8600b0028b1848aabemr605792pjb.2.1702600473015; Thu, 14 Dec
2023 16:34:33 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 14 Dec 2023 16:34:32 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=185.250.212.81; posting-account=99ziWAoAAADLScDbI_CyfIcpa_gFZ0zh
NNTP-Posting-Host: 185.250.212.81
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b2bc76a6-e3a0-4579-b569-93f1219903cdn@googlegroups.com>
Subject: Problem with clock scan
From: gregor.e...@googlemail.com (greg)
Injection-Date: Fri, 15 Dec 2023 00:34:33 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1236
 by: greg - Fri, 15 Dec 2023 00:34 UTC

Problem with clock scan
What am I doing wrong?

#Debian and Tcl/Tk 8.6.13
#https://www.tcl-lang.org/man/tcl/TclCmd/clock.htm#M25

puts [clock format [clock scan "2023 11" -format "%Y %m"] -format "%Y %m" ]

#Output:
#2023 12

#expected
#2023 11

Re: Problem with clock scan

<58af2c48-869c-4356-990c-e1389fc5685dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12579&group=comp.lang.tcl#12579

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:7707:b0:425:8980:23e4 with SMTP id ki7-20020a05622a770700b00425898023e4mr85158qtb.9.1702617977223;
Thu, 14 Dec 2023 21:26:17 -0800 (PST)
X-Received: by 2002:a05:6830:3142:b0:6d9:a017:1b1e with SMTP id
c2-20020a056830314200b006d9a0171b1emr6909735ots.2.1702617976902; Thu, 14 Dec
2023 21:26:16 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Thu, 14 Dec 2023 21:26:16 -0800 (PST)
In-Reply-To: <b2bc76a6-e3a0-4579-b569-93f1219903cdn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=185.250.212.115; posting-account=99ziWAoAAADLScDbI_CyfIcpa_gFZ0zh
NNTP-Posting-Host: 185.250.212.115
References: <b2bc76a6-e3a0-4579-b569-93f1219903cdn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <58af2c48-869c-4356-990c-e1389fc5685dn@googlegroups.com>
Subject: Re: Problem with clock scan
From: gregor.e...@googlemail.com (greg)
Injection-Date: Fri, 15 Dec 2023 05:26:17 +0000
Content-Type: text/plain; charset="UTF-8"
 by: greg - Fri, 15 Dec 2023 05:26 UTC

greg schrieb am Freitag, 15. Dezember 2023 um 01:34:36 UTC+1:
> Problem with clock scan
> What am I doing wrong?
>
> #Debian and Tcl/Tk 8.6.13
> #https://www.tcl-lang.org/man/tcl/TclCmd/clock.htm#M25
>
> puts [clock format [clock scan "2023 11" -format "%Y %m"] -format "%Y %m" ]
>
> #Output:
> #2023 12
>
puts [clock format [clock scan "2023 11 1" -format "%Y %m %d"] -format "%Y %m"]
#2023 11

#clock needs a complete date

> #expected
> #2023 11

Re: Problem with clock scan

<ulhv33$1vgtn$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12580&group=comp.lang.tcl#12580

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.n...@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Re: Problem with clock scan
Date: Fri, 15 Dec 2023 16:32:35 +0000
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <ulhv33$1vgtn$1@dont-email.me>
References: <b2bc76a6-e3a0-4579-b569-93f1219903cdn@googlegroups.com>
<58af2c48-869c-4356-990c-e1389fc5685dn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 15 Dec 2023 16:32:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d567ecc87796e4bbd13e0966a5b4f10b";
logging-data="2081719"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q/a32MxkB/b7JOr2iRCXdqlj1JDQhkYs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AapSdDss2liqXBQhp3In/iTfYmc=
In-Reply-To: <58af2c48-869c-4356-990c-e1389fc5685dn@googlegroups.com>
Content-Language: en-US
 by: Alan Grunwald - Fri, 15 Dec 2023 16:32 UTC

On 15/12/2023 05:26, greg wrote:
> greg schrieb am Freitag, 15. Dezember 2023 um 01:34:36 UTC+1:
>> Problem with clock scan
>> What am I doing wrong?
>>
>> #Debian and Tcl/Tk 8.6.13
>> #https://www.tcl-lang.org/man/tcl/TclCmd/clock.htm#M25
>>
>> puts [clock format [clock scan "2023 11" -format "%Y %m"] -format "%Y %m" ]
>>
>> #Output:
>> #2023 12
>>
> puts [clock format [clock scan "2023 11 1" -format "%Y %m %d"] -format "%Y %m"]
> #2023 11
>
> #clock needs a complete date
>
>> #expected
>> #2023 11
Disclaimer: I haven't tried this.

On output %d produces a two-digit date; although it's documented that it
should work on input with a single digit, maybe it doesn't.

Try

[clock scan "2023 11 1" -format "%Y %m %e"

There's also always the option of *insisting" that the input date is
specified as, e.g. "2023 11 01".

Good luck!

Re: Problem with clock scan

<94ba232e-3b51-4f1c-b1a1-a9788213009an@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12590&group=comp.lang.tcl#12590

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:22a5:b0:425:f77f:6794 with SMTP id ay37-20020a05622a22a500b00425f77f6794mr51729qtb.2.1702687348672;
Fri, 15 Dec 2023 16:42:28 -0800 (PST)
X-Received: by 2002:a05:6214:20c8:b0:67f:2195:a5a9 with SMTP id
8-20020a05621420c800b0067f2195a5a9mr32593qve.11.1702687348415; Fri, 15 Dec
2023 16:42:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 15 Dec 2023 16:42:28 -0800 (PST)
In-Reply-To: <ulhv33$1vgtn$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=185.250.212.115; posting-account=99ziWAoAAADLScDbI_CyfIcpa_gFZ0zh
NNTP-Posting-Host: 185.250.212.115
References: <b2bc76a6-e3a0-4579-b569-93f1219903cdn@googlegroups.com>
<58af2c48-869c-4356-990c-e1389fc5685dn@googlegroups.com> <ulhv33$1vgtn$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <94ba232e-3b51-4f1c-b1a1-a9788213009an@googlegroups.com>
Subject: Re: Problem with clock scan
From: gregor.e...@googlemail.com (greg)
Injection-Date: Sat, 16 Dec 2023 00:42:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4530
 by: greg - Sat, 16 Dec 2023 00:42 UTC

Alan Grunwald schrieb am Freitag, 15. Dezember 2023 um 17:32:41 UTC+1:
> On 15/12/2023 05:26, greg wrote:
> > greg schrieb am Freitag, 15. Dezember 2023 um 01:34:36 UTC+1:
> >> Problem with clock scan
> >> What am I doing wrong?
> >>
> >> #Debian and Tcl/Tk 8.6.13
> >> #https://www.tcl-lang.org/man/tcl/TclCmd/clock.htm#M25
> >>
> >> puts [clock format [clock scan "2023 11" -format "%Y %m"] -format "%Y %m" ]
> >>
> >> #Output:
> >> #2023 12
> >>
> > puts [clock format [clock scan "2023 11 1" -format "%Y %m %d"] -format "%Y %m"]
> > #2023 11
> >
> > #clock needs a complete date
> >
> >> #expected
> >> #2023 11
> Disclaimer: I haven't tried this.
>
> On output %d produces a two-digit date; although it's documented that it
> should work on input with a single digit, maybe it doesn't.
>
> Try
>
> [clock scan "2023 11 1" -format "%Y %m %e"
>
> There's also always the option of *insisting" that the input date is
> specified as, e.g. "2023 11 01".

Thank you for your reply.

if {0} {
https://www.tcl-lang.org/man/tcl/TclCmd/clock.htm
clock scan inputString ?-option value...?
Scans a time that is expressed as a character string and produces an integer number of seconds. See SCANNING TIMES for a full description.
SCANNING TIMES
The clock scan command accepts times that are formatted as strings and converts them to counts of seconds from the epoch time of 1 January 1970, 00:00 UTC. It normally takes a -format option that is followed by a string describing the expected format of the input. (See FREE FORM SCAN for the effect of clock scan without such an argument.) The string consists of any number of characters other than the per-cent sign (“%”), interspersed with any number of format groups, which are two-character sequences beginning with the per-cent sign. The permissible format groups, and their interpretation, are described under FORMAT GROUPS.

%d
On output, produces the number of the day of the month, as two decimal digits. On input, matches one or two digits, possibly with leading whitespace, that are expected to be the number of the day of the month.
%e
On output, produces the number of the day of the month, as one or two decimal digits (with a leading blank for one-digit dates). On input, matches one or two digits, possibly with leading whitespace, that are expected to be the number of the day of the month.

}

puts "1: [clock format [clock scan "2023 11" -format "%Y %m"] -format "%Y %m"]"
puts "2: [clock format [clock scan "2023 11 1" -format "%Y %m %d"] -format "%Y %m"]"
puts "3: [clock format [clock scan "2023 11 1" -format "%Y %m %e" ] -format "%Y %m"]"

#1: 2023 12
#2: 2023 11
#3: 2023 11

if {0} {

At 2: and 3: the expected expression appears

The date must be complete. If not, there is no error message, but the current date is simply used.
In my opinion, there is no reference to this behavior in the clock manual.

The behavior already described in
https://wiki.tcl-lang.org/page/clock+scan#1be5d28b62789d56c4f9cc2017721b4ecbe192de4e4d3fd18c4812b4ba55cfbc
}

>
> Good luck!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor