Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Timestamps and milliseconds
Wed, Jul 4 2007 9:25 PMPermanent Link

"Jeff Cook"

Hi

I've pored through the postings on the website newsgroups and still
can't work out how to set a timestamp field.

My code currently says:-

 apmDM.LogTable.Insert;
 apmDM.LogTableLoggedAt.AsDateTime := Now;

But the Delphi 6 Help says (see below) that it will lose the
milliseconds.  How do I avoid this?  DBISAM 3.30.

Cheers

Jeff
========= help as below ===============  

Now function

Returns the current date and time.

Unit

SysUtils

Category

date/time routines

function Now: TDateTime;

Description

Returns the current date and time, corresponding to Date + Time.

Note:   Although TDateTime values can represent milliseconds, Now only
returns the time to the closest second.

--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz
+
Joan and Jeff Cook
The Cooks Oasis
www.cookislandsoasis.com
Wed, Jul 4 2007 10:33 PMPermanent Link

"Robert"

"Jeff Cook" <jeffc@aspect.co.nz> wrote in message
news:765A0D11-D081-4CE3-8075-69AF89051789@news.elevatesoft.com...
>
>
> Note: Although TDateTime values can represent milliseconds, Now only
> returns the time to the closest second.
>

A documentation error, apparently. The following seems to work correctly.

var s : string;

begin
 DateTimeToString(s, 'yy mm dd hh mm ss zzzz', now);
 showmessage(s);

Robert

Thu, Jul 5 2007 3:55 PMPermanent Link

"Jeff Cook"
Robert wrote:

> DateTimeToString(s, 'yy mm dd hh mm ss zzzz', now);
>  showmessage(s);

There you go.  I'm always getting in trouble for not reading the Help
and then when I finally do ... the Help is wrong  Grrrrrrrrr....

Thanks Robert

Cheers

Jeff

--
Jeff Cook
Aspect Systems Ltd
www.aspect.co.nz
+
Joan and Jeff Cook
The Cooks Oasis
www.cookislandsoasis.com
Image