Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

FACILITY REJECTED 100044200000;


devel / comp.lang.tcl / What day is tomorrow?

SubjectAuthor
* What day is tomorrow?Luc
+* What day is tomorrow?Harald Oehlmann
|`* What day is tomorrow?Christian Gollwitzer
| +* What day is tomorrow?Harald Oehlmann
| |`* What day is tomorrow?Arjen Markus
| | `* What day is tomorrow?Harald Oehlmann
| |  `- What day is tomorrow?Christian Gollwitzer
| `- What day is tomorrow?Ralf Fassel
+- What day is tomorrow?Robert Heller
`- What day is tomorrow?Gerald Lester

1
What day is tomorrow?

<20230123033739.46709581@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!E/LO6yoX9eOSOpUO8R7y3g.user.46.165.242.75.POSTED!not-for-mail
From: no...@no.no (Luc)
Newsgroups: comp.lang.tcl
Subject: What day is tomorrow?
Date: Mon, 23 Jan 2023 03:37:39 -0300
Organization: Aioe.org NNTP Server
Message-ID: <20230123033739.46709581@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="24582"; posting-host="E/LO6yoX9eOSOpUO8R7y3g.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
 by: Luc - Mon, 23 Jan 2023 06:37 UTC

Today is 23 so tomorrow is 24, no problem.

But if today was the 30th, how would I know what day tomorrow is?
The 31st or the 1st?

Easy. Just check what the month is.

But then I would need to maintain two lists:
30-day months and 31-day months.

And there is always February, of course. So I also have to check
if it's a leap year.

Or maybe I can just get today's Epoch, add 86400 seconds and get
the date corresponding to the resulting Epoch.

I can do all that by myself, but it definitely sounds like a wheel
that someone else has invented already.

Do you know of any? I would like to see what other tools there
might be in that toolbox.

I haven't found anything in Tcllib or Tclx.

--
Luc
>>

Re: What day is tomorrow?

<tqld82$3hca9$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: What day is tomorrow?
Date: Mon, 23 Jan 2023 08:33:23 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <tqld82$3hca9$1@dont-email.me>
References: <20230123033739.46709581@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 23 Jan 2023 07:33:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c232b27d0c4af1dd8b01bc58121625b3";
logging-data="3715401"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+9www3Zkr8x61LiVtZPzWi"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:4XwyBXBns91So3kBBVj+RTVMtYo=
Content-Language: en-GB
In-Reply-To: <20230123033739.46709581@lud1.home>
 by: Harald Oehlmann - Mon, 23 Jan 2023 07:33 UTC

Am 23.01.2023 um 07:37 schrieb Luc:
> Today is 23 so tomorrow is 24, no problem.
>
> But if today was the 30th, how would I know what day tomorrow is?
> The 31st or the 1st?
>
> Easy. Just check what the month is.
>
> But then I would need to maintain two lists:
> 30-day months and 31-day months.
>
> And there is always February, of course. So I also have to check
> if it's a leap year.
>
> Or maybe I can just get today's Epoch, add 86400 seconds and get
> the date corresponding to the resulting Epoch.
>
> I can do all that by myself, but it definitely sounds like a wheel
> that someone else has invented already.
>
> Do you know of any? I would like to see what other tools there
> might be in that toolbox.
>
> I haven't found anything in Tcllib or Tclx.
>
>

clock format [clock add [clock seconds] 1 day] -format %d

Re: What day is tomorrow?

<tqlf1c$3hm7b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: aurio...@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: What day is tomorrow?
Date: Mon, 23 Jan 2023 09:03:55 +0100
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <tqlf1c$3hm7b$1@dont-email.me>
References: <20230123033739.46709581@lud1.home> <tqld82$3hca9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 23 Jan 2023 08:03:56 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="87ebcd6e499c9c0125334ba29612f02b";
logging-data="3725547"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+s1RGd85RPKfNuYtEcgTJCAQky13nrfUE="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Cancel-Lock: sha1:HF+9LzbuEAj9/9SbGtpUUvVaGAU=
In-Reply-To: <tqld82$3hca9$1@dont-email.me>
 by: Christian Gollwitzer - Mon, 23 Jan 2023 08:03 UTC

Am 23.01.23 um 08:33 schrieb Harald Oehlmann:
> Am 23.01.2023 um 07:37 schrieb Luc:
>> Today is 23 so tomorrow is 24, no problem.
>>
>> But if today was the 30th, how would I know what day tomorrow is?
>> The 31st or the 1st?
>
> clock format [clock add [clock seconds] 1 day] -format %d
>
Or use the free-form clock parser:

clock format [clock scan tomorrow] -format %d

It also understands "now + 1 day" and similar things

Christian

Re: What day is tomorrow?

<tqlfcr$3hca9$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: What day is tomorrow?
Date: Mon, 23 Jan 2023 09:10:05 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tqlfcr$3hca9$2@dont-email.me>
References: <20230123033739.46709581@lud1.home> <tqld82$3hca9$1@dont-email.me>
<tqlf1c$3hm7b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 23 Jan 2023 08:10:03 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c232b27d0c4af1dd8b01bc58121625b3";
logging-data="3715401"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18u42Q8SKxnv+fqu58ANeUq"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:78aGyjmZ5VrhLiud7kTFSOHXtHI=
In-Reply-To: <tqlf1c$3hm7b$1@dont-email.me>
Content-Language: en-GB
 by: Harald Oehlmann - Mon, 23 Jan 2023 08:10 UTC

Am 23.01.2023 um 09:03 schrieb Christian Gollwitzer:
> Am 23.01.23 um 08:33 schrieb Harald Oehlmann:
>> Am 23.01.2023 um 07:37 schrieb Luc:
>>> Today is 23 so tomorrow is 24, no problem.
>>>
>>> But if today was the 30th, how would I know what day tomorrow is?
>>> The 31st or the 1st?
>>
>> clock format [clock add [clock seconds] 1 day] -format %d
>>
> Or use the free-form clock parser:
>
> clock format [clock scan tomorrow] -format %d
>
> It also understands "now + 1 day" and similar things
>
>     Christian

Wow, I did not know this! You learn each day! Thanks,
Harald

Re: What day is tomorrow?

<2c5453b8-70de-4f25-ae37-4657ffa27075n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:428c:b0:3b6:2df9:b0aa with SMTP id cr12-20020a05622a428c00b003b62df9b0aamr881244qtb.579.1674467745249;
Mon, 23 Jan 2023 01:55:45 -0800 (PST)
X-Received: by 2002:a81:4984:0:b0:4fb:3501:6d9e with SMTP id
w126-20020a814984000000b004fb35016d9emr2128145ywa.454.1674467745019; Mon, 23
Jan 2023 01:55:45 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.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: Mon, 23 Jan 2023 01:55:44 -0800 (PST)
In-Reply-To: <tqlfcr$3hca9$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=136.231.212.241; posting-account=A91wAAoAAADgBUxBX6QqsrSD26GLhVp8
NNTP-Posting-Host: 136.231.212.241
References: <20230123033739.46709581@lud1.home> <tqld82$3hca9$1@dont-email.me>
<tqlf1c$3hm7b$1@dont-email.me> <tqlfcr$3hca9$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2c5453b8-70de-4f25-ae37-4657ffa27075n@googlegroups.com>
Subject: Re: What day is tomorrow?
From: arjen.ma...@gmail.com (Arjen Markus)
Injection-Date: Mon, 23 Jan 2023 09:55:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2081
 by: Arjen Markus - Mon, 23 Jan 2023 09:55 UTC

On Monday, January 23, 2023 at 9:10:07 AM UTC+1, Harald Oehlmann wrote:
> Am 23.01.2023 um 09:03 schrieb Christian Gollwitzer:
> > Am 23.01.23 um 08:33 schrieb Harald Oehlmann:
> >> Am 23.01.2023 um 07:37 schrieb Luc:
> >>> Today is 23 so tomorrow is 24, no problem.
> >>>
> >>> But if today was the 30th, how would I know what day tomorrow is?
> >>> The 31st or the 1st?
> >>
> >> clock format [clock add [clock seconds] 1 day] -format %d
> >>
> > Or use the free-form clock parser:
> >
> > clock format [clock scan tomorrow] -format %d
> >
> > It also understands "now + 1 day" and similar things
> >
> > Christian
> Wow, I did not know this! You learn each day! Thanks,
> Harald

You should be a bit careful with that: the free-form parser is a bit quirky, if I understand it correctly. One reason to stay with the more formal arithmetic.

Regards,

Arjen

Re: What day is tomorrow?

<tqllsm$3hca9$3@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: wortka...@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: What day is tomorrow?
Date: Mon, 23 Jan 2023 11:00:54 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <tqllsm$3hca9$3@dont-email.me>
References: <20230123033739.46709581@lud1.home> <tqld82$3hca9$1@dont-email.me>
<tqlf1c$3hm7b$1@dont-email.me> <tqlfcr$3hca9$2@dont-email.me>
<2c5453b8-70de-4f25-ae37-4657ffa27075n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 23 Jan 2023 10:00:54 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c232b27d0c4af1dd8b01bc58121625b3";
logging-data="3715401"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Kpuoo+5hkP6UwoZqDOSRU"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:wdMFjSh5mTKlOEYUU3GshyJvEoY=
In-Reply-To: <2c5453b8-70de-4f25-ae37-4657ffa27075n@googlegroups.com>
Content-Language: en-GB
 by: Harald Oehlmann - Mon, 23 Jan 2023 10:00 UTC

Am 23.01.2023 um 10:55 schrieb Arjen Markus:
> On Monday, January 23, 2023 at 9:10:07 AM UTC+1, Harald Oehlmann wrote:
>> Am 23.01.2023 um 09:03 schrieb Christian Gollwitzer:
>>> Am 23.01.23 um 08:33 schrieb Harald Oehlmann:
>>>> Am 23.01.2023 um 07:37 schrieb Luc:
>>>>> Today is 23 so tomorrow is 24, no problem.
>>>>>
>>>>> But if today was the 30th, how would I know what day tomorrow is?
>>>>> The 31st or the 1st?
>>>>
>>>> clock format [clock add [clock seconds] 1 day] -format %d
>>>>
>>> Or use the free-form clock parser:
>>>
>>> clock format [clock scan tomorrow] -format %d
>>>
>>> It also understands "now + 1 day" and similar things
>>>
>>> Christian
>> Wow, I did not know this! You learn each day! Thanks,
>> Harald
>
> You should be a bit careful with that: the free-form parser is a bit quirky, if I understand it correctly. One reason to stay with the more formal arithmetic.
>
> Regards,
>
> Arjen

Yes, and it is depreciated. So, maybe remove it in 9.0 ;-).
But the solution by Christian is just beautiful !

Take care,
Harald

Re: What day is tomorrow?

<ygacz75a7qa.fsf@akutech.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: What day is tomorrow?
Date: Mon, 23 Jan 2023 11:03:09 +0100
Lines: 59
Message-ID: <ygacz75a7qa.fsf@akutech.de>
References: <20230123033739.46709581@lud1.home> <tqld82$3hca9$1@dont-email.me>
<tqlf1c$3hm7b$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net xyDcqhfDb9PhXM4lA2VVmgWXzjbcYQAw4ub2SthNODLRJH2IE=
Cancel-Lock: sha1:oc0y++ud80Ozpa2z3Bu4tCFMF0U= sha1:rdyh4MvE2Ap5lXuMD2jmEyoJ0k8=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Mon, 23 Jan 2023 10:03 UTC

* Christian Gollwitzer <auriocus@gmx.de>
| Am 23.01.23 um 08:33 schrieb Harald Oehlmann:
| > Am 23.01.2023 um 07:37 schrieb Luc:
| >> But if today was the 30th, how would I know what day tomorrow is?
| >> The 31st or the 1st?
| >
| > clock format [clock add [clock seconds] 1 day] -format %d
| >
| Or use the free-form clock parser:
>
| clock format [clock scan tomorrow] -format %d
>
| It also understands "now + 1 day" and similar things

But be aware of the subtle differences between "24 hours" and "1 day":

% clock format [clock scan "now"]
Mon Jan 23 10:53:41 CET 2023

% clock format [clock scan "now + 24 hours"]
Tue Jan 24 10:53:41 CET 2023

% clock format [clock scan "now + 1 day"]
Tue Jan 24 00:00:00 CET 2023

% clock format [clock scan tomorrow]
Tue Jan 24 00:00:00 CET 2023

% info patchlevel
8.6.13

I would have expected that "now + 1 day" produces the same result as
"now + 24 hours", since the docs state:

FREE FORM SCAN
relative time
A specification relative to the current time. The format is
number unit. Acceptable units are year, fortnight, month, week,
day, hour, minute (or min), and second (or sec). The unit can
be specified as a singular or plural, as in 3 weeks. These mod-
ifiers may also be specified: tomorrow, yesterday, today, now,
last, this, next, ago.

The actual date is calculated according to the following steps.

First, any absolute date and/or time is processed and converted. Using
that time as the base, day-of-week specifications are added. Next,
relative specifications are used.
!!! If a date or day is specified, and no absolute or relative
!!! time is given, midnight is used.
Finally, a correction is applied so that the correct hour of the
day is produced after allowing for daylight savings time
differences and the correct date is given when going from the end
of a long month to a short month.

(Emphasis by me)

HTH
R'

Re: What day is tomorrow?

<O2SdnV6H8Y21HFP-nZ2dnZfqn_SdnZ2d@giganews.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!69.80.99.23.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 23 Jan 2023 12:44:24 +0000
MIME-Version: 1.0
From: hel...@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.15)
Subject: Re: What day is tomorrow?
In-Reply-To: <20230123033739.46709581@lud1.home>
References: <20230123033739.46709581@lud1.home>
Newsgroups: comp.lang.tcl
Content-Type: text/plain; charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <O2SdnV6H8Y21HFP-nZ2dnZfqn_SdnZ2d@giganews.com>
Date: Mon, 23 Jan 2023 12:44:24 +0000
Lines: 47
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-OtcfKVLq+G1CZJaeFNTiKR92RKRkKBQ65uHHMHVNaEZtV+f/5I2jmB+QftOzwIZuxT/Bt9CiR2rrtme!yS5hDTTZ3QfdgO1ZHhHZ4rNS1lRbsXECHA+EM0Xhs8y4aeOPaYp91PpssWWgP0LBMWilRaSz6qB1!7L4=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 2725
 by: Robert Heller - Mon, 23 Jan 2023 12:44 UTC

It is built-in: the clock command will tell you.

clock add timeVal ?count unit...? ?-option value?

proc nextdate {month date year} {
return [clock format [clock add [clock scan \
[format {%04d-%02d-%02d} $year $month $date] \
-format {%Y-%m-%d}] 1 day] -format {%m %d %Y}]
}

At Mon, 23 Jan 2023 03:37:39 -0300 Luc <no@no.no> wrote:

>
> Today is 23 so tomorrow is 24, no problem.
>
> But if today was the 30th, how would I know what day tomorrow is?
> The 31st or the 1st?
>
> Easy. Just check what the month is.
>
> But then I would need to maintain two lists:
> 30-day months and 31-day months.
>
> And there is always February, of course. So I also have to check
> if it's a leap year.
>
> Or maybe I can just get today's Epoch, add 86400 seconds and get
> the date corresponding to the resulting Epoch.
>
> I can do all that by myself, but it definitely sounds like a wheel
> that someone else has invented already.
>
> Do you know of any? I would like to see what other tools there
> might be in that toolbox.
>
> I haven't found anything in Tcllib or Tclx.
>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: What day is tomorrow?

<tqm1ut$1jf8$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!r3Dtd2rR+KDSJJOKXiq23Q.user.46.165.242.75.POSTED!not-for-mail
From: Gerald.L...@KnG-Consulting.net (Gerald Lester)
Newsgroups: comp.lang.tcl
Subject: Re: What day is tomorrow?
Date: Mon, 23 Jan 2023 07:26:52 -0600
Organization: KnG Consulting, LLC
Message-ID: <tqm1ut$1jf8$1@gioia.aioe.org>
References: <20230123033739.46709581@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="52712"; posting-host="r3Dtd2rR+KDSJJOKXiq23Q.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Gerald Lester - Mon, 23 Jan 2023 13:26 UTC

On 1/23/23 00:37, Luc wrote:
> Today is 23 so tomorrow is 24, no problem.
>
> But if today was the 30th, how would I know what day tomorrow is?
> The 31st or the 1st?
>
> Easy. Just check what the month is.
>
> But then I would need to maintain two lists:
> 30-day months and 31-day months.
>
> And there is always February, of course. So I also have to check
> if it's a leap year.
>
> Or maybe I can just get today's Epoch, add 86400 seconds and get
> the date corresponding to the resulting Epoch.
>
> I can do all that by myself, but it definitely sounds like a wheel
> that someone else has invented already.
>
> Do you know of any? I would like to see what other tools there
> might be in that toolbox.
>
> I haven't found anything in Tcllib or Tclx.

Read the manual page for the clock command, pay attention to the section
on the clock add subcommend.

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald.Lester@kng-consulting.net |
+----------------------------------------------------------------------+

Re: What day is tomorrow?

<tqmmjl$3o8mp$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: aurio...@gmx.de (Christian Gollwitzer)
Newsgroups: comp.lang.tcl
Subject: Re: What day is tomorrow?
Date: Mon, 23 Jan 2023 20:19:17 +0100
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <tqmmjl$3o8mp$1@dont-email.me>
References: <20230123033739.46709581@lud1.home> <tqld82$3hca9$1@dont-email.me>
<tqlf1c$3hm7b$1@dont-email.me> <tqlfcr$3hca9$2@dont-email.me>
<2c5453b8-70de-4f25-ae37-4657ffa27075n@googlegroups.com>
<tqllsm$3hca9$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 23 Jan 2023 19:19:17 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="27eced4339c27ca7f7160694db74be76";
logging-data="3941081"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/zcAawAuKX5G6MOwmQPcdXE+RfvLi08+E="
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.6.1
Cancel-Lock: sha1:CsEbgjOS8B7oPp9ero0Xo8LS3g8=
In-Reply-To: <tqllsm$3hca9$3@dont-email.me>
 by: Christian Gollwitzer - Mon, 23 Jan 2023 19:19 UTC

Am 23.01.23 um 11:00 schrieb Harald Oehlmann:
> Am 23.01.2023 um 10:55 schrieb Arjen Markus:
>> On Monday, January 23, 2023 at 9:10:07 AM UTC+1, Harald Oehlmann wrote:
>>> Am 23.01.2023 um 09:03 schrieb Christian Gollwitzer:
>>>> Am 23.01.23 um 08:33 schrieb Harald Oehlmann:
>>>>> Am 23.01.2023 um 07:37 schrieb Luc:
>>>>>> Today is 23 so tomorrow is 24, no problem.
>>>>>>
>>>>>> But if today was the 30th, how would I know what day tomorrow is?
>>>>>> The 31st or the 1st?
>>>>>
>>>>> clock format [clock add [clock seconds] 1 day] -format %d
>>>>>
>>>> Or use the free-form clock parser:
>>>>
>>>> clock format [clock scan tomorrow] -format %d
>>>>
>>>> It also understands "now + 1 day" and similar things
>>>>
>>>>      Christian
>>> Wow, I did not know this! You learn each day! Thanks,
>>> Harald
>>
>> You should be a bit careful with that: the free-form parser is a bit
>> quirky, if I understand it correctly. One reason to stay with the more
>> formal arithmetic.
>>
>> Regards,
>>
>> Arjen
>
> Yes, and it is depreciated. So, maybe remove it in 9.0 ;-).
> But the solution by Christian is just beautiful !

I know it is deprecated and I think it is a mistake to completely take
it away, since it has these nice features. If it is moved away, I think
it should go into something like
clock scan -format free "tomorrow"
or "clock guess tomorrow" or maybe into tcllib.

Christian

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor