Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

clock scan 24:00 gives an error
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?





Report this thread to moderator Post Follow-up to this message
Old Post
Earl Grieda
04-22-05 08:58 AM


Re: clock scan 24:00 gives an error
"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



Report this thread to moderator Post Follow-up to this message
Old Post
Jeff Godfrey
04-22-05 08:58 AM


Re: clock scan 24:00 gives an error
"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.



Report this thread to moderator Post Follow-up to this message
Old Post
Earl Grieda
04-22-05 08:58 AM


Re: clock scan 24:00 gives an error
Earl Grieda wrote:
> "Jeff Godfrey" <jeff_godfrey@pobox.com> wrote in message
> news:xxX9e.10074$yq6.1564@newsread3.news.pas.earthlink.net... 
case of 
>
> 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.


Report this thread to moderator Post Follow-up to this message
Old Post
Khaled
04-22-05 08:58 AM


Re: clock scan 24:00 gives an error
"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



Report this thread to moderator Post Follow-up to this message
Old Post
Earl Grieda
04-22-05 08:58 AM


Re: clock scan 24:00 gives an error
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

Report this thread to moderator Post Follow-up to this message
Old Post
Arjen Markus
04-22-05 01:58 PM


Re: clock scan 24:00 gives an error
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 i
s
> 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)

Report this thread to moderator Post Follow-up to this message
Old Post
Matthias Kraft
04-22-05 01:58 PM


Re: clock scan 24:00 gives an error
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

Report this thread to moderator Post Follow-up to this message
Old Post
Kevin Kenny
04-22-05 09:01 PM


Re: clock scan 24:00 gives an error
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"

Report this thread to moderator Post Follow-up to this message
Old Post
Peter Flynn
04-23-05 08:58 AM


Re: clock scan 24:00 gives an error
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


Report this thread to moderator Post Follow-up to this message
Old Post
Khaled
04-24-05 08:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:23 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.