Hello! Looks like this DateTime field is like a Unix dateTime field except it uses a different starting date (1904 VS 1970).
Unix timestamp fields use January 1st 1970 as their starting point and count the number of seconds since then. One other consideration is whether the field you are working with is using Greenwich mean time for their dates or if they are using local time. Having said that, one day = 86400 seconds. By dividing the date you have by this number, you can get the number of days in your date and this should translate to a Std Delphi Date Time field. I had a similar problem a couple of weeks earlier with a Unix timestamp and I found a function that seemed to work for me: function UNIXTimeToDateTimeFAST(UnixTime: LongWord): TDateTime; begin Result := (UnixTime / 86400) + 25569; end; I wish I knew why the function added 25569 to the number, but I don't. You can Google "Delphi converting unix time to date" to go to the links I used when I did research on this. Good Luck! Tom Nesler -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Neil Beshoori Sent: Tuesday, November 13, 2012 4:19 PM To: [email protected] Subject: Help with dateTime problem Hi I am using my trusty old Delphi 5 and struggling with the following problem I am trying to interpret a Truetype/opentype font creation date. I can read other data from the 'head' table in the font file correctly but not the timedate issue The spec has the following description (http://www.microsoft.com/typography/otspec/head.htm) Format LONGDATETIME which is Number of seconds since 12:00 midnight, January 1, 1904. 64-bit integer I am creating an array of word to read this structure with the following longDateTime = array[0..3] of Word; I am aware of the swapped words issues. One font has date 06/08/1990 and time 14:54:50 The hex dump in the file is 00 00 00 00 A2 E3 27 2A Can anybody please help/explain how I can get above date/time from this hex dump? kind regards Neil _______________________________________________ Delphi mailing list [email protected] http://lists.elists.org/cgi-bin/mailman/listinfo/delphi _______________________________________________ Delphi mailing list [email protected] http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

