Hi Przemek,

> The .prg level timestamp arithmetic for me should be as closed as possible
> to date one. I think that the best part of xHarbour datetime implementation
> is the possibilities to easy replace existing date fields with datetime
> ones
> and that the whole code works in the same way, f.e.:
>   SET FILTER TO dt - 1 >= DATE .AND. DATE <= dt + 2
> works well in all combinations of DATE and DATETIME used in 'dt' and DATE.
> Such code also works without any modifications:
>   SET FILTER TO date() - 7 >= SALE_DATE .AND. SALE_DATE <= date() - 1
> for SALE_DATE declared as pure DATE or TIMESTAMP. Walter made it really
> nice.
> If we want to keep it then it will determinate the base value returned by
> TIMESTAMP1 - TIMESTAMP2 and all other calculations. It will have to be
> number
> where integer parts is julian day and fraction part is time.


Sounds reasonable to me.

We'd need some helpers though to free users from
computing day fractions to/from normal everyday terms
like hours, minutes and seconds. Those fractions are
pretty cryptic in their raw form.

One hour is 0.041667 day.

countries it's strictly defined and can be calculated for each year from
> some rule, f.e. this one is for Poland:
>   TZ="CET-1CEST-2,M3.5.0,M10.5.0"
> but it works only for last 15 years and if I want to converts some
> earlier daytime values I have to use tables with hard coded periods
> for summer and winter time. In GLIBC source code you can find such
> tables for different countries and years.
> Probably the only one reasonable implementation we can fully implement
> in core code is introducing offset to UTC time but not real timezone
> implementation.


Very ugly indeed. Well, I think offset is pretty much enough for most
practical business purposes, and it doesn't block the way for 3rd party
tools to implement "proper" (if we can use this word for the TZ system
of the world in practice ;) TZ support with all the gory details of it.

I have no idea however, how to introduce offset in syntaxes in an
elegant way, especially in the fixed position format.

Brgds,
Viktor
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to