Delphi format (TDateTime):
Delphi TDateTime is equals to double value. The integral part of a Delphi TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of the TDateTime value is fraction of a 24 hour day that has elapsed.
Following are some examples of TDateTime values and their corresponding dates and times:
0 12/30/1899 12:00 am
2.75 1/1/1900 6:00 pm
-1.25 12/29/1899 6:00 am
35065 1/1/1996 12:00 am
C++ format (Unix format):
C++ time is an integer value that shows how many seconds passed sinse 01/01/1970.
Converting functions:
Code: Select all
unsigned int UnixStartDate = 25569;
unsigned int DateTimeToUnix(double ConvDate)
{
return((unsigned int)((ConvDate - UnixStartDate) * 86400.0));
}
double UnixToDateTime(unsigned int USec)
{
return((Usec/86400.0) + UnixStartDate);
}