So you need to convert the type TDateTime, used in Delphi, to type QDateTime Qt. TDateTime is a floating point number, where the integer part is the number of days from December 30, 1899 to the current day, and the fractional part is the number of seconds from the beginning of the day.
QDateTime Converter :: fromTDateTime (double tDateTime) { int time_t = (int) ((tDateTime - 25569.16666) * 86400); // got the time in time_t format return QDateTime :: fromTime_t (time_t); }
25569.16666 is January 1, 1970 in the format of TDateTime. 86400 - the number of seconds in one day. ')
In a real program, both magic numbers are replaced by constants.
The inverse transform is performed in reverse order.