2 Replies Latest reply on Nov 6, 2010 10:21 AM by FentonJones

    Delphi TDateTime format conversion

    ElvinBirth

      Title

      Delphi TDateTime format conversion

      Post

      I would like to convert the DelphiTDateTime recorded in OziE and OziCE track flies to a form of timestamp recognized by FMPro. Is there an existing algorithm or calculation to do that?

      Here is the OziE Help file explanation of the format:

      Date Format
      Delphi stores date and time values in the TDateTime type. The integral part of a TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a TDateTime value is the time of day.
      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

       Thanks for your attention,

      Mac OSX 10.6.4, FMPro Advanced 11.0v2

        • 1. Re: Delphi TDateTime format conversion
          davidanders

          Not an exact answer

          http://fentonjones.com/Articles/19_DateTime.html

          From another forum...

          Filemaker represents dates internally as the number of days since 1/1/0001.

          Hence, you can just set a field (of type date) equal to 5968, and then use the Month, Day, and Year functions on that field, to return the month, day, and year offsets relative to 1/1/1. Note that this will include leap years. This would give 5/4/17.

          If you want to make the returned date relative to some other date, say, January 1, 2010 (733773 days after 1-1-0001), you would instead set date to 733773 + 5968.

          There is also a function on Brian Dunning's site that will take a julian date number and convert it to a gregorian or julian date which may be of interest. http://www.briandunning.com/cf/239 -- note commas in function should be changed to decimals.

          http://sixfriedrice.com/wp/comparing-dates-in-filemaker/

          • 2. Re: Delphi TDateTime format conversion
            FentonJones

            FileMaker Timestamps are I believe stored internally as a number; it is currently: 63424632584

            It is the number of seconds since: 1/1/0001 12:00 AM

            35065.25 * 86400 // convert to seconds
            +
            Timestamp ( Date (12;30;1899); Time (0;0;0))

            Result (as FileMaker Timestamp): 1/1/1996 6:00 AM

            This seems a little weird to me, as the Delphi TS, from FileMaker's point of view, should be negative, but FileMaker shows it as a positive number, if the result is number.