Subject Re: Hourly rate
Author Ali Gökçen
--- In, Helen Borrie <helebor@t...>
> >TIME is not a cosmic static point!
> A TIME value represents a static point in a day (according to the
> clock convention observed by many mortals and computing devices on
> planet).

Yup, meaning of static is depends on perspectif.
It is static becouse the countries static.
It is not static because, humans are portable with some objects.
It is static because local users focused on local time.
It is not static because there is Daylight savings and time tunings
about world turning around speed lost.
etc etc..

> In Firebird, TIME is *stored* as a 32-bit unsigned integer (not
> representing the number of ten-thousandths of a second that have
> since midnight. It will never be higher than 863,999,999 because
it is
> constrained to this limit. Internally, this number is handled as

I know this. it is what i said to Martijn.
TIME is a numeric value >= 0 and <86400

How can you will calculate it without decimal value?

Some digital systems can keep TIME parts in different registers.

Time.Hours register between 0 and 23
Time.Minutes Register between 0 and 59
Time.Seconds Register between 0 and 59
Time.Milliseconds Register between 0 999

Milliseconds counter register feeding by freq. oscilator.
when it become 1000, logic gates resets it to zero and
adds 1 to Seconds,
when seconds become 60, logic gates resets it to zero and
adds 1 to minutes

Or there is only one big integer register counts oscilator signals.
You can build TIME or TIMESTAMP from this number.

It is not importand how you keep time numbers.
But, if you want to some calculation with it you must to be obey
math rules.
High level users/end users may dont interested about how it
We are programmer of the computers, so wee need to
learn basic calculation rules.
Programmer doesnt mean drag-dropper or function caller or IDE

> In some DBMS's, that's true, because they store date and time data
> numbers that can be computed by simple arithmetic, e.g. Paradox.
> fiddling around with a datapump, perhaps. But you can't use SQL to
> the stored form of a TIME type, nor to store it as its raw type.
And you
> cannot "import" a raw date or time datum from another DBMS and
expect it to
> work with Firebird. Date/time storage is absolutely vendor-

I never used pardox or dbase but i used
and alot of 3thgen languages.

calculation of TIME overvlows in TIME datatype without any lost?
is this a new fashion with 4. or >=5. generation system?

> And the Firebird engine does its TIME and DATE computations in C
in order
> to store and retrieve date/time data. But data-users do their
> in SQL. SQL uses symbols taken from English, but that does not
mean that
> SQL is semantically mapped to English. In English, if we want to
know the
> time-of-day, we ask "What is the TIME?" It is that gloss that SQL
> borrowed (and not "Can you estimate the TIME it will take?")

Helen it is not about English or any other language.
It is about Logic, Digital technology depends on math and other
We are lowest level computer users, if we don't intersted about
technical calculation details, who will does it?

Don't say me SQL is not related about
logic or technology or programming knowladge.
You can't be good RDBMS user without modern math and programming

> In Firebird, in SQL, you can add a numeric(9,4) number n
(seconds) to a
> TIME to get a result of TIME type that is that time-of-day + n
seconds (or
> an overflow), you can subtract n seconds to get a TIME type result
(or an
> underflow) and you can subtract one TIME type from another TIME
type to get
> a difference interval in seconds (or an underflow).
> >if you know a quick way about TIME,DATE,TIMESTAMP calculation,
> >i will happy to learn it from you.
> To do what? In SQL you can "add" a DATE type to a TIME type to
give a
> TIMESTAMP result. Under the hood, this concatenates the DATE
> representation (also a constrained 32-bit integer with a scale of
4) to the
> TIME representation. However, since this is a concatenation
> (appending time-of-day to a date-only value), you
cannot "subtract" a TIME
> from a TIMESTAMP to get a DATE type.

It is written as possible in my book.
You can substract a time value from a timestamp and can assign
result to a date datatype. They are numeric values and i can play
with them what i want. I dont need any high level support.

You know, there was no TIME datatype before IBv6.
we keept times in smallint fields with check constraints.
and there was no DATE only datatype also.
we keept dates in smallint fields with...
and there was no extract also...
we calculted them ourself.

> You can add a number n to or subtract a number n from a DATE or
> to advance or reduce the value by n days. The stored value of a
> TIMESTAMP can be negative: this will happen for anything earlier
> November 17, 1898. In resolving these numbers, the engine counts
> until it hits the lower limit of numeric(9,4), which is some point
in time
> around AD 10, at which point (if it hasn't finished) it will throw
> underflow exception. That means Firebird can't store dates
earlier than
> that limit. (Task for you, Ali: compute Firebird's lowest and
highest dates!)

heh! you saying this to me Helen???
Instead of Martijn or Arnoldo? LOL!

This is what i said:
You can calculate your TIME and TIMESTAMP values with FB even
there is no directly high level support.

Now, what is your goal?
1- FB not anough to calculate TIME related datatypes.
and we must to improve it.
2- FB anough to solve your problem, programmers must to improve
their logic and knowladgebase.
3- Go street ahead.

> If you think Firebird's "date zero" (1898-11-17) is a funny date,
you might
> be interested in Jim Starkey's posting to Firebird-general a
couple of days
> ago. It has a mythology all its own. :-)

Uncle Jim?
(aka OBBW: object oriented big bad wolf or Obsesif big bad wolf)
I allways read his and other developers posts.
He is my ideol.
How many systems are there still lives today and will live in future
like IB/FB architecture?
The design is same as first day, only driver engine changes.
I don't interested about some resource related field expantions.
As a programmer, i know all tecnical/resource restrictions and
bad HW designs around 1980s.
There may be some side effects coming from old restricted days on

Is he a bad Computer expert than lerry or billy or michel..??
No, never.
However he is also not richer than any IT based populer name.
Because of he focused on ideal technogy, not on money money

I was start to design an write my ideal RDBMS, around 1992, but i
abandoned it whenever i see Interbase in a magazine(Byte may be.
there was no internet and google) wheel was there!

> ./heLen