On Tue, 10 Feb 2009, Szak�ts Viktor wrote:

Hi,

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

Here support for constant time values should greatly help. User will
not have to make any calculations manually. Just simply t"01:00" will
be enough, f.e.:
   tValue += t"01:00"
We have to define also supported math operations and item type for results.
I suggest to make it date compatible too and define that date + timestamp
and timestamp + date gives timestamp as result. The list of legal operations
will look like:
   <t> + <t> => <t>
   <t> - <t> => <n>
   <t> + <n> => <t>
   <n> + <t> => <t>
   <t> - <n> => <t>

   <d> + <t> => <t>
   <t> + <d> => <t>
   <d> - <t> => <n>
   <t> - <d> => <n>

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

The formatted text format like:
   t"YYYY-MM-DD hh:mm:ss.ccc"
can be extended by UTC+-NNNN sufix, f.e.:
   t"2009-02-10 18:39:47 UTC+0100"
It will be sth like output of:
   date "+%F %X UTC%z"
plus optional .ccc as number of milliseconds.
But we can also use TZ rules only for conversions and leave to user
how he want to internally use timestamp value. In some programs it
may be UTC time in some other local. The important is only the way
how this information is exchanged with the rest of world. Here in
many representation the UTC offset is missing so it's always necessary
to use UTC values and only make conversions to local time when they are
presented.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to