-hh-
"J Smith" <bsmit...@rogers.com> wrote in message
news:3e618dd7$1...@newsgroups.borland.com...
Actually, this is D6... and I can't find a DCU that does this.
The syntax in the example is: DateTimeDiff(DT1,DT2,Days,Secs);
where DT1 and DT2 are dates. (The order doesn't matter) This is in a help
file. There is a comment about using the "StDateTime" part of DateUtils,
but there is no such animal in DateUtils that I can find.
What I really want to do is calculate the difference between two date/time
fields/variables in years, months, days, hours and seconds.
"Henk Holterman" <rent-a...@xs4all.nl> wrote in message
news:3e61f18f$1...@newsgroups.borland.com...
>I am trying to use DateTimeDiff. The problem is that I get an error that
>the system doesn't know what DateTimeDiff is.
That function is part of a third party library named SysTools which
was formerly a product of TurboPower Sofwtare. It is NOT a part of
Delphi, itself.
Search your hard drive for a file named StDate.pas.
However, I still have the same problem. Have you seen anything out there to
do this?Using DecodeDateTime and breaking everything up into integers for
subtraction is clumsy and results in things like -11 months.
"Doug Chamberlin" <dchamberlinATandoversoftwareDOTcom> wrote in message
news:50546vgbgk8hgkkj9...@4ax.com...
http://www.esbconsult.com.au/ look in the download section for esbdates.
It has everything you will every need for working with dates.
Edwin
"J Smith" <bsmit...@rogers.com> wrote in message
news:3e622c0e$1...@newsgroups.borland.com...
"Edwin Walker" <ewa...@mcs.net> wrote in message
news:3e6246af$1...@newsgroups.borland.com...
>That is interesting. I never bought SysTools 3.
Well, you can get it now for free at
http://sourceforge.net/users/tpsfadmin/
since TurboPower open sourced it.
Since months are not all of the same length, you need to consider the
meaningfulness of that wish.
For technical work, subtract the TDateTimes to get the difference in
days. Use Trunc to get the integer days difference; use DecodeTime to
get from the fractional part the hours, minutes, and seconds.
If you require years months days to fulfil an administrative need,
determine what rules the administration require.
--
© John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm
Dates - miscdate.htm moredate.htm js-dates.htm pas-time.htm critdate.htm etc.
"Doug Chamberlin" <dchamberlinATandoversoftwareDOTcom> wrote in message
news:tim46v0guj9ua9vns...@4ax.com...