Subject Re: TIME calculation errors Ali Gökçen 2005-04-18T22:28:53Z
Hi Helen,
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 12:25 PM 18/04/2005 +0000, you wrote:
>
>
> > > Yup. Linguistic confusion. TIME answers the question "what
is the
> >time?",
> > > not "what time did it take?"
> > >
> >Helen,
> >excuse me if i wrong, but,
> >we can use TIME data type to store elapsed time if we have good
enough
> >reasons.
>
> No. You can't. What would you store if the elapsed time exceeded
one day?

First, i didn't intend to say time2-time1 should give result in time
format.
(it may be about my bad english) of course it must be a numeric
value.
i mean, time_elapsed = time_zero + (time2-time1) is not a weird
operation.
it may be if you sure what you do and if there is no overflow
posibility.
you may need to store elapsed time in time format by using
'00:00' as time + interval in some case.
of course you can get back that interval as number
by time_elapsed - time_zero. (time_zero = '00:00')

what gives a chronometer when starts ? only seconds? numeric(9,4) ?
it gives time value if i remember correctly.
because intervals is for computers not for people.
imagine a athletics race, runners runs in daylight.
there is no 24H overflow posibility about elapsed time calculation.
what will we say to people about score?
hey this runner score is 1245.7562 ?
but we can say hey his score is:
cast('00:00' as TIME)+(finish_time-start_time)
why i can't store it as TIME in DB ?
is it must be accourding to greenwich time?
why not be cyronometers elapsed TIME value?
TIME is only a data format in protected range, i think.

>
> >if both time values in same day, we can use delta value to reset
> >start_time, to use as chronometer.
> >TIME allways gives an elapsed value if u ask "what is the time?"
> >because there is no date info in it.
>
> It's true that it *represents* an elapsed value in storage,
insofar as it
> is "the time elapsed since midnight today". We just don't
know/care what
> day. It will roll over to 00:00:00.0000 as soon as it has passed
> 23:59:59.9999.
>
> >so "what is the time?" is actually mean of "what time did it
take?"
> >from midnight.
>
> In the same fashion as "what is the date?" means "How long has it
been
> since AD 0.0.0000?" But dates (like times) are interpreted as
> snapshots. When we subtract one from another, we get an interval
of time -
> "How much time elapsed between these two moments?"
>
> ./hb

yes, "what is date?" means how many years plus months and days
passed since A.D 00.00.0000.(offset value)
time is cycled and independed from date value.
every day is 24 hours, but date is not cycled it is incremental,
there is theorical start point(1800?) only to calculate intervals by
using days (TIME). because not every years are 365 days, february
dancing to balance to syncronize with worlds orbit.
On the other hand a day is not 24H exactly, worlds turning speed is
chancing. ( there is no stability in cosmo, except Firebird! ;) )

Ali