// In DateUtils Unit, There are two functions...
function CompareDate(const A, B: TDateTime);
// if two dates are equal then result:=0;
function DateOf(const AValue: TDateTime): TDateTime;
//Gives us only date
uses DateUtils;
var
A: TDateTime;
B: TDateTime;
if CompareDate(DateOf(A),DateOf(B))=0 Then
//whatever...
Andries Bos <[EMAIL PROTECTED]> wrote:
Hello
I do have two TDateTime values to compare.
var
A: TDateTime;
B : TDateTime;
Debugging gives me a value for the variable of A = 38676 and B = 38676,1. Using
the delhi debugging function will show the values
A : (DateTimeToStr(A) : '20-11-2005' and
B : (DateTimeToStr(B) '20-11-2005 2:24:00'
I would like to compare these two dates and check if they are equal (on the
same day). Dayofweek would not help because these dates could b within
different weeks
However checking using the integrated debigger var A with either of the
functions : DateOf(A) Trunc(A) or Int(A) will all result in a value of 38675
!!.
Doing the same with B will succeed en give me the value I would expect (38676).
(As I'm doing something conditional , the debugging values will also show at a
normal run).
I've tried to store the outcome of the functions into a local variable, but
this also does not solve my problem.
Any suggestions?
regards
Andries
The Netherlands
---------------------------------
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
SPONSORED LINKS
C programming language Computer programming languages Java
programming language The c programming language C programming language
Concept of programming language
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
_ .
<_ [ |-| /-\ |\|
---------------------------------
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/