[Lazarus] DateDif function needed

J├╝rgen Hestermann juergen.hestermann at gmx.de
Sat Nov 9 11:37:18 CET 2013


Am 2013-11-08 21:35, schrieb John Landmesser:
 > i'm searching a pascal datetime function that simulates an Excel function: "DateDif"
 > Excel for example knows the function DateDif that returns the number of Years, month and days between Date1 and date2.
 > Date1 := 21.12.2012
 > Date2 := 01.01.2013
 > Result would be: 0 years, 0 moths, 11 days


I have written my own function because I wanted to
store dates in YYYY.MM.DD.MM.SS format and didn't
like any conversions back and forth between other
formats like TDateTime etc.

Find attached a time-diff routine based on some types (also included).
Maybe it is of help for you.
(Comments and function names are partly in german so you may need to change them).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TimeDiff.pas
Type: text/x-pascal
Size: 5654 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131109/89eb3766/attachment-0001.pas>


More information about the Lazarus mailing list