Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DateTimeDiff

3 views
Skip to first unread message

J Smith

unread,
Mar 2, 2003, 12:04:28 AM3/2/03
to
I am trying to use DateTimeDiff. The problem is that I get an error that
the system doesn't know what DateTimeDiff is. This happens with the
examples, too. Is there something other than dateUtils I need to use? I am
beginning to feel slightly dumb, here..


Henk Holterman

unread,
Mar 2, 2003, 6:57:10 AM3/2/03
to

I did a quick search in Delphi7\Source and Delphi7\Demos but
'DateTimeDiff' doesn't show up. So, what are you trying to do and what
examples are you talking about?

-hh-


"J Smith" <bsmit...@rogers.com> wrote in message
news:3e618dd7$1...@newsgroups.borland.com...

J Smith

unread,
Mar 2, 2003, 8:41:54 AM3/2/03
to
Thanks for the response.

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...

Doug Chamberlin

unread,
Mar 2, 2003, 9:25:15 AM3/2/03
to
On Sun, 2 Mar 2003 00:04:28 -0500, "J Smith" <bsmit...@rogers.com>
wrote:

>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.


J Smith

unread,
Mar 2, 2003, 11:19:37 AM3/2/03
to
That is interesting. I never bought SysTools 3.

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...

Edwin Walker

unread,
Mar 2, 2003, 1:04:34 PM3/2/03
to
I think there is a function in esbdates that does this.

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...

J Smith

unread,
Mar 2, 2003, 2:20:06 PM3/2/03
to
Looks good. I'll try it.

"Edwin Walker" <ewa...@mcs.net> wrote in message
news:3e6246af$1...@newsgroups.borland.com...

Doug Chamberlin

unread,
Mar 2, 2003, 2:25:04 PM3/2/03
to
On Sun, 2 Mar 2003 11:19:37 -0500, "J Smith" <bsmit...@rogers.com>
wrote:

>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.

Dr John Stockton

unread,
Mar 2, 2003, 2:28:49 PM3/2/03
to
JRS: In article <3e620716$1...@newsgroups.borland.com>, seen in news:borla
nd.public.codecentral, J Smith <bsmit...@rogers.com> posted at Sun, 2
Mar 2003 08:41:54 :-

>
>What I really want to do is calculate the difference between two date/time
>fields/variables in years, months, days, hours and seconds.

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.

J Smith

unread,
Mar 2, 2003, 11:09:36 PM3/2/03
to
Done, already. Along with others. However, I get a read error, so will try
again.

"Doug Chamberlin" <dchamberlinATandoversoftwareDOTcom> wrote in message

news:tim46v0guj9ua9vns...@4ax.com...

0 new messages