Subject Re: Hourly rate Ali Gökçen 2005-10-23T08:18:11Z
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> >TIME is not a cosmic static point!
>
> A TIME value represents a static point in a day (according to the
24-hour
> clock convention observed by many mortals and computing devices on
this
> 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
BigInt),
> representing the number of ten-thousandths of a second that have
elapsed
> since midnight. It will never be higher than 863,999,999 because
it is
> constrained to this limit. Internally, this number is handled as
DECIMAL(9,4).

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
when seconds become 60, logic gates resets it to zero and
...

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
calculated.
We are programmer of the computers, so wee need to
learn basic calculation rules.
Programmer doesnt mean drag-dropper or function caller or IDE
player..

>
> In some DBMS's, that's true, because they store date and time data
as
> numbers that can be computed by simple arithmetic, e.g. Paradox.
By
> fiddling around with a datapump, perhaps. But you can't use SQL to
retrieve
> 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-
specific.
>

I never used pardox or dbase but i used
VISAM,SQL/370,ORACLE,INFORMIX,BTRIEVE,INTERBASE
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
computations
> 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
has
> 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
sciences.
We are lowest level computer users, if we don't intersted about
technical calculation details, who will does it?
Gates/Ellison/Dell/Honda..?

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
knowlange.(algorythm)

> 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
operation
> (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
TIMESTAMP
> to advance or reduce the value by n days. The stored value of a
DATE or
> TIMESTAMP can be negative: this will happen for anything earlier
than
> November 17, 1898. In resolving these numbers, the engine counts
backwards
> 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
an
> 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.

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

>
> 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
There may be some side effects coming from old restricted days on
Jim.

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
moooneeyyy..

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
>

Regards.
Ali