Delphi/Windows compatibility. 30/12/1899 = TDateTime(0).
And yes, there is a bug in there that now features as convention. It is not a Pascal bug.
What the DOS/Windows engineers tried to do was make it 1900/1/1/ 00:00:00 or 1899/12/31 23:59:59:999 so you can blame that on Bill Gates himself, or CP/M engineers...
I forgot which one.....
uses sysutils;
begin
writeln(DateTimeToStr(0));
end.
Unix time starts at 1970/1/1/00:00:00, btw.
Everything has been working fine until yesterday night
That's something I don't believe......This has always been the case.
Date property is of type TDateTime. It doesn't know nil. With some massage you can do this, though:
uses sysutils,dateutils;
begin
writeln(DateTimeToStr(DateTimeToUnix(0)));
end.
This will display 0-0-0.
The actual value, however is -2209161600