Page 1 of 1

Why default value for date is 0 ?

Posted: 24.02.2009, 17:06
by ddantoni
Hi,
when I do a GetDate on a field which is null or egal to "0000-00-00", the GetDate method return me 0.
0 is not the default value for Delphi's date :
DateToStr(0) -> 30/12/1899
DateToStr(-700000) -> 00/00/0000

Also this constant (-700000) is always used to define a null date in Delphi.

Maybe the 0 is the default date value for others platforms that Delphi which Zeos is developped for but in this case a parameter would be perfect to pass from one default date to the other.

Thanks,
David

Posted: 25.02.2009, 12:07
by mdaems
David,
This is something we should have a look at. I can't do it right now and I'll forget about it. It would be better if you made a bug tracker issue for it.

I should try to figure out how the fpc rtl and lazarus handle dates as well. So this might take some time. There are 2 probably related bugs tracked recently. Might help when they are handled together.

Mark

Posted: 25.02.2009, 13:21
by ddantoni
Hi Mark,
I posted my first bug report: http://zeosbugs.firmos.at/view.php?id=171
I hope my description is enough clear.

Thanks,
David