DecodeDate bug? (with Paradox table timestamp) 
Author Message
 DecodeDate bug? (with Paradox table timestamp)

When using the

Present : TDateTime;
Present:=Now;
DecodeDate(Present, Year, Month, Date)

it returns the Year correctly.  

However, if I take the DateTime value for Present from a paradox database

DecodeDate procedure
e.g. for the current year does return Year=1899 instead of Year=1998 !!  

Is this a known bug or do I do something wrong?

Regards




Mon, 09 Apr 2001 03:00:00 GMT  
 DecodeDate bug? (with Paradox table timestamp)
Your problem is likely related to the origin Delphi now uses for its
TDateTime (which is just a Double).  I think starting with D2 the origin of
dates became

30/12/1899

What I am try to say is TDateTime value of 0 (zero) represents the date
30/12/1899.

Try this:

procedure TForm1.Button1Click(Sender: TObject);
var
  ADateTime : TDateTime;
begin
ADateTime := 0.0;
Edit1.Text := FormatDateTime('dd/mm/yyyy',0);
end;

If you change the above code to ADateTime := Now; then the value of
ADateTime will be the number of days from 30/12/1899.  That doesn't really
solve your problem but it may help you figure out what is wrong.  Good Luck
Antero.

Graham.

Quote:

>When using the

>Present : TDateTime;
>Present:=Now;
>DecodeDate(Present, Year, Month, Date)

>it returns the Year correctly.

>However, if I take the DateTime value for Present from a paradox database

>DecodeDate procedure
>e.g. for the current year does return Year=1899 instead of Year=1998 !!

>Is this a known bug or do I do something wrong?

>Regards





Tue, 10 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Trouble assigning TimeStamp@ from paradox table

2. BDE Reset my paradox tables (Bug?)

3. How to decode Paradox TimeStamp field

4. Delphi/Paradox timestamp help needed

5. Paradox DATES, TIMES, TIMESTAMPS

6. Putting Paradox Timestamp Field into Dialog Edit box

7. Paradox Timestamp format: how to decode

8. TimeStamp in Delphi/Paradox 7

9. Bug alert: Your 16-bit Paradox tables might already be corrupt! (Old bug still not solved)

10. Updating Paradox 5 tables to Paradox 7

11. Rebuilding a Paradox table without paradox?

12. Paradox 4 Versus Paradox 5 Tables

 

 
Powered by phpBB® Forum Software