Subject Re: Timestamps in ORDER BY Clause?
Author barfingdog_2004
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 09:30 PM 28/05/2004 +0000, you wrote:
> > > >
> > > > I still need milliseconds in a timestamp, What
> > > > do you suggest for that? An additional millisecond
> > > > field in the table?
> > > >
> > > > Thanks
> > > > Larry
> > >
>
> The timestamp format already supports ten-thousandths of seconds. A
full
> timestamp literal looks like this:
>
> '29.05.2004 10:42:15.5432'
>
> The problem you'll have is that the system date doesn't deliver
subseconds
> to CURRENT_TIMESTAMP or 'NOW'. This (as I understand it) comes from
a Unix
> limitation.
>
> If you don't care about what the actual subsecond time was, but only
the
> order of things, you could store the system time in one field and
pick a
> value off a generator for an associated unique ordering.
>
> /heLen

Thanks Helen:

The timestamp string in the "INSERT INTO" statement
comes from from the system's time structure. In the
case of Windows, that's a SYSTEMTIME structure.

So I build a text string like this:

2004-05-27 22:03:01.578

The ms value is passed to the database. I don't know
if it saved.

The IBPP::Time's GetTime() function is defined as

void GetTime(int& hour, int& minute, int& second) const;

Is the millisecond value extracted from the database?

How do I get it?

Thanks
Larry