Thread: time value '24:00:00'

time value '24:00:00'

From
"pgsql-general@list.coretech.ro"
Date:
hello,

can the the current time family functions (CURRENT_TIMESTAMP, LOCALTIME,
etc) reach the '24:00:00' value ?

I want to compare LOCALTIME <= '24:00:00'::TIME and I am curios to know
if LOCALTIME < '24:00:00'::TIME is sufficient.


thanks,
razvan radu



Re: time value '24:00:00'

From
"Uwe C. Schroeder"
Date:
why don't you just use < '00:00:00'::time
and avoid the issue?

IMHO there shouldn't even be a 24:00:00, because that would imply that there
is a 24:00:01 - which there is not.
It should go from 23:59 to 00:00
But then, I didn't write the spec for time in general, so maybe there is a
24:00 which is identical to 00:0=

UC


On Wednesday 01 November 2006 13:15, pgsql-general@list.coretech.ro wrote:
> hello,
>
> can the the current time family functions (CURRENT_TIMESTAMP, LOCALTIME,
> etc) reach the '24:00:00' value ?
>
> I want to compare LOCALTIME <= '24:00:00'::TIME and I am curios to know
> if LOCALTIME < '24:00:00'::TIME is sufficient.
>
>
> thanks,
> razvan radu
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly


--
Open Source Solutions 4U, LLC    1618 Kelly St
Phone:  +1 707 568 3056        Santa Rosa, CA 95401
Cell:   +1 650 302 2405        United States
Fax:    +1 707 568 6416

Re: time value '24:00:00'

From
Richard Huxton
Date:
Uwe C. Schroeder wrote:
> why don't you just use < '00:00:00'::time
> and avoid the issue?
>
> IMHO there shouldn't even be a 24:00:00, because that would imply that there
> is a 24:00:01 - which there is not.
> It should go from 23:59 to 00:00
> But then, I didn't write the spec for time in general, so maybe there is a
> 24:00 which is identical to 00:00

Ah, times and dates are wonderful things though. For example, '23:59:60'
is a valid time (and not equal to 24:00:00 or 00:00:00) every so often.

http://en.wikipedia.org/wiki/Leap_second

--
   Richard Huxton
   Archonet Ltd

Re: time value '24:00:00'

From
"Uwe C. Schroeder"
Date:
On Thursday 02 November 2006 00:16, Richard Huxton wrote:
> Uwe C. Schroeder wrote:
> > why don't you just use < '00:00:00'::time
> > and avoid the issue?
> >
> > IMHO there shouldn't even be a 24:00:00, because that would imply that
> > there is a 24:00:01 - which there is not.
> > It should go from 23:59 to 00:00
> > But then, I didn't write the spec for time in general, so maybe there is
> > a 24:00 which is identical to 00:00
>
> Ah, times and dates are wonderful things though. For example, '23:59:60'
> is a valid time (and not equal to 24:00:00 or 00:00:00) every so often.
>
> http://en.wikipedia.org/wiki/Leap_second

Yeah, but isn't the third part milliseconds? Doesn't "milli" imply 1000 and
not 60. I may be totally off here though - well, it's getting late

    UC

--
Open Source Solutions 4U, LLC    1618 Kelly St
Phone:  +1 707 568 3056        Santa Rosa, CA 95401
Cell:   +1 650 302 2405        United States
Fax:    +1 707 568 6416

Re: time value '24:00:00'

From
Richard Huxton
Date:
Uwe C. Schroeder wrote:
>> Ah, times and dates are wonderful things though. For example, '23:59:60'
>> is a valid time (and not equal to 24:00:00 or 00:00:00) every so often.
>>
>> http://en.wikipedia.org/wiki/Leap_second
>
> Yeah, but isn't the third part milliseconds? Doesn't "milli" imply 1000 and
> not 60. I may be totally off here though - well, it's getting late

Nope - hh:mm:ss.milli
And it's early in London, so it *must* be late in Western U.S.A. - see
you later :-)

--
   Richard Huxton
   Archonet Ltd

Re: time value '24:00:00'

From
"Uwe C. Schroeder"
Date:
On Thursday 02 November 2006 00:59, Richard Huxton wrote:
> Uwe C. Schroeder wrote:
> >> Ah, times and dates are wonderful things though. For example, '23:59:60'
> >> is a valid time (and not equal to 24:00:00 or 00:00:00) every so often.
> >>
> >> http://en.wikipedia.org/wiki/Leap_second
> >
> > Yeah, but isn't the third part milliseconds? Doesn't "milli" imply 1000
> > and not 60. I may be totally off here though - well, it's getting late
>
> Nope - hh:mm:ss.milli
> And it's early in London, so it *must* be late in Western U.S.A. - see
> you later :-)

You're right of course. Seconds! Who would have thought about that :-)
It's past 1am, so I guess I should go hit the mattress ...

PS: and I heard it's darn cold over there too ....

    Uwe

--
Open Source Solutions 4U, LLC    1618 Kelly St
Phone:  +1 707 568 3056        Santa Rosa, CA 95401
Cell:   +1 650 302 2405        United States
Fax:    +1 707 568 6416

Re: time value '24:00:00'

From
Richard Huxton
Date:
Uwe C. Schroeder wrote:
> On Thursday 02 November 2006 00:59, Richard Huxton wrote:
>> Uwe C. Schroeder wrote:
>>>> Ah, times and dates are wonderful things though. For example, '23:59:60'
>>>> is a valid time (and not equal to 24:00:00 or 00:00:00) every so often.
>>>>
>>>> http://en.wikipedia.org/wiki/Leap_second
>>> Yeah, but isn't the third part milliseconds? Doesn't "milli" imply 1000
>>> and not 60. I may be totally off here though - well, it's getting late
>> Nope - hh:mm:ss.milli
>> And it's early in London, so it *must* be late in Western U.S.A. - see
>> you later :-)
>
> You're right of course. Seconds! Who would have thought about that :-)
> It's past 1am, so I guess I should go hit the mattress ...
>
> PS: and I heard it's darn cold over there too ....

Winter has finally arrived in the U.K. - I hear it was -6C in Wales
first thing this morning.

--
   Richard Huxton
   Archonet Ltd

Re: time value '24:00:00'

From
"Christopher Browne"
Date:
On 11/1/06, Uwe C. Schroeder <uwe@oss4u.com> wrote:
>
> why don't you just use < '00:00:00'::time
> and avoid the issue?
>
> IMHO there shouldn't even be a 24:00:00, because that would imply that there
> is a 24:00:01 - which there is not.
> It should go from 23:59 to 00:00
> But then, I didn't write the spec for time in general, so maybe there is a
> 24:00 which is identical to 00:0

Keep in mind the times when there is an extra leap second added in.  I
suspect that in those cases, we get "23:60"; that seems actually a
little bit stranger than 24:00...
--
http://www3.sympatico.ca/cbbrowne/linux.html
Oddly enough, this is completely standard behaviour for shells. This
is a roundabout way of saying `don't use combined chains of `&&'s and
`||'s unless you think Gödel's theorem is for sissies'.