Quantcast
Channel: DA-SOFT Technologies - Forum
Viewing all articles
Browse latest Browse all 1040

Subject: Milliseconds in DateTime - by: Support

$
0
0
Hello Firebird TIMESTAMP data type stores data with milliseconds. Now() as a TIMESTAMP value will be stored with milliseconds. So, to fetch a record you should specify a value with milliseconds too. And AnyDAC here works correctly, and BDE does not (truncates milliseconds). As a workaround, you should trim milliseconds from Now() value. You can use the function: [code]function NowNoMS: TDateTime; var y, mo, d, h, m, s, ms: Word; begin Result := Now(); DecodeDate(Result, y, mo, d); DecodeTime(Result, h, m, s, ms); Result := EncodeDate(y, mo, d) + EncodeTime(h, m, s, 0); end;[/code]

Viewing all articles
Browse latest Browse all 1040

Trending Articles