Micro Focus QTP (UFT) Forums

Full Version: Date Function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I want to get System Date Minus time in my checkpoint. My checkpoint fails because my Expected Value is the System Date & my Actual Value is the System Date + Time . I need to retreive only Date & not time from my Datatable . Is there any way we can do that & how it needs to be done.

Thanks in Advance,
Nilu Verma
The TODAY() Function and the NOW() Function
The TODAY function returns the serial number of today's date based on your system clock and does not include the time. The NOW function returns the serial number of today's date and includes the time.

So, make an entry in your datatable without the quotes "=TODAY()"
Get the Date only using the Date (Build in constant)
Depending on which format you need, you can get the data also separately:

Day(now)
Month(now)
Year(now)
You can use date() function. This will display the system date(usually in mm/dd/yyyy formate)

example:
Code:
Dim tdate
tdate=date()
msgbox tdate

Regards
Raj