« First Trip On Transit | E2328 Linker error while emitting metadata » |
It's not straight-up obvious how to convert the Borland and Microsoft formats back and forth in code, but it does end up being pretty easy.
TDateTimes are in "OA" format, which is OLE/COM-compatible. The functions that convert back and forth to the OLE format work just fine for TDateTimes as well.
MSDate := DateTime.FromOADate(BorlandDate);
BorlandDate := MSDate.ToOADate();
The syntax is nigh identical on the C# side apart from the assignment operator (= instead of :=).
Note that if the TDateTime arrives as an object in C# somewhere, you can simply cast it as a double; you do not need to cast it specifically as a TDateTime.