Hi Viktor,
Il 10/02/2009 19.02, Viktor Szakáts ha scritto:
Hi Przemek,
> I have no idea however, how to introduce offset in syntaxes in an
> elegant way, especially in the fixed position format.
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.
Sounds good.
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.
Nice, but could we avoid this strange syntax t"<text>" ?
I find it rather strange in Harbour. Any problems with the
already used function name (hb_ctot) and 0t... approach?
Maybe we'd need another notation for time without date:
0h0100 => meaning 01:00 (plus empty date)
0h015827 => meaning 01:58:27 (plus empty date)
0t20090209 => meaning 2009-02-09 00:00:00
0t20090209203510 => meaning 2009-02-10 20:35:10
hb_ctot( "2009-02-10 18:39:47 UTC+0100" ) => meaning 2009-02-10 18:39:47
UTC+0100
hb_ctot() could also accept all formats you wrote for t"":
hb_ctot( "01:00" )
hb_ctot( "01:58:27" )
hb_ctot( "2009-02-09" )
hb_stot() could use the strict format:
hb_stot( "20090210" )
hb_stot( "20090210183947" )
hb_stot( "20090210183947+0100" )
I vote to adopt both notations that will be useful in many cases:
0t*, 0h* are faster and precise, but t"" I found very interesting,
because it is more readable.
My 2 cents,
Best regards
Francesco
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour