In aqDatetime Object, GetDate() fucntion is missing.
for eg no direct way to compare x = 2019-08-19 with y = 2019-08-19:11:55:25.00.00
x <>y
hence y need to rip out time fraction to be x=y
aqDateTime.Compare(x, y) =0
In aqDatetime Object, GetDate() fucntion is missing.
for eg no direct way to compare x = 2019-08-19 with y = 2019-08-19:11:55:25.00.00
x <>y
hence y need to rip out time fraction to be x=y
aqDateTime.Compare(x, y) =0
aqDateTime.Today gets the current date.
aqDateTime.Now gets the current date and time
aqDateTime.Time gets the current time
So, GetDate is replaced with Today. If you need to do anything where you're adding dates, months, years, etc., there are methods for that as well.
See https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqdatetime/methods.html
Seems you did not understood the problem...
there is nothing to do with Today()...............
eg:- from external application I receve date time say x= '11/12/2014 9:58:11'
in test complete script I have date say y ='11/12/2014'
I need to compare x and y say both are same (if you ignore time component.........)
if i used
aqDateTime.Compare(x,y)
result will be 1 or -1 not 0 .. b'cos of time component of x
only way to get result both are same ....have to rip off time...
like below ..can remove seconds...
y = aqDateTime.AddSeconds(y, - aqDateTime.GetSeconds(y))
hours ...
minutes...
why can't TC provide me a single function?
Are these strings? Or are they objects of type DateTime?
If they are strings, then this is string manipulation, not DateTime processing. I wouldn't even use aqDateTime.Compare. Heck,, you just want to see if x contains y, right?
if aqString.Contains(x,y) <> 0 then "Dates do not match" else "Dates match"
It's simply a matter of finding the right function.