On Wed, 18 Mar 2009, Edmer wrote:

Hi,

> Has this been finalized already ?

Yes I implemented it. But before I'll commit it I would like to
cleanup function names and create some small set of functions
to operate on timestamp values.

I check in the internet functions used by ADS and VFP to operate
on timestamp/datetime types and they are not compatible in few
places so it will be hard to create sth strictly compatible with
both implemenation. I think we will have to stay with our own.

/* ADS functions: */
TSTOD( <timeStamp> ) -> <date>
STOTS( <cTimeStamp> ) -> <timeStamp>   // "YYYYMMDD HH:MM:SS.mmm"
CTOTS( <cTimeStamp> ) -> <timeStamp>   // "DTOC_DATE HH:MM:SS.mmm"
CTOT( <cTime> ) -> <time>              // "HH:MM:SS.mmm"
NOW() -> <timeStamp>
TODAY() -> <date>                      // the same as DATE()

/* VFP functions: */
TTOC( <timeStamp> [, <nMode> ] ) -> <cTimeStamp>
            // 1. yyyymmddhhmmss
            // 2. _SET_DATE HH:MM:SS.mmm(_SET_HOURS=12/24, _SET_SECONDS=ON/OFF)
            // 3. yyyy-mm-ddThh:mm:ss (XML DateTime format)
CTOT( <cTimeStamp> ) -> <timeStamp>    // "YYYY-MM-DDThh:mm:ss"
TTOD( <timeStamp> ) -> <date>
DTOT( <date> ) -> <timeStamp>
SEC( <timeStamp> ) -> <nSec>
MINUTE( <timeStamp> ) -> <nMinutes>
HOUR( <timeStamp> ) -> <nHour>
DATETIME() -> <timeStamp>
// DATE() and DATETIME() support optional numeric parameters to
// create new <date> or <dateTime> value in format:
// [nYear, nMonth, nDay [, nHours [, nMinutes [, nSeconds]]]]

Now I would like to ask your proposition for letter used to mark
milliseconds in _SET_TIME format. xHarbour use 'c', f.e.:
   hh:mm:ss.ccc
I used 'f':
   hh:mm:ss.fff
but of course I can change it but I would like to make it before
1-st commit to not increase the noise.
So I'm interesting in group opinion. It cannot be 'h', 'm' or 's'.
The next question is about default some modifiers for transform
function, f.e. to show only time part without date when timestamp
value is formatted. I haven't found any information about such modifiers
in ADS or VFP.
Do you have any propositions?

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

Reply via email to