Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting System Date in Checkpoint
#9
Solved: 10 Years, 9 Months, 2 Weeks ago
Hi,

You can achieve you goal by using the below ways:

1.
Code:
User formatdatetime, if your date is in the format of mm/dd/yyyy.
msgbox(formatdatetime(date()))  'displays date in 7/19/2008
msgbox(formatdatetime(date,2))  'displays date in 7/19/2008
2. Or else you can use some logic to put the date in your required format, here use datepart function:
I used the below code to verify the "Current Time:"(date part) displayed in the top right corner of this page.

Code:
dayPart=datepart("d",date())
monthPart=datepart("m",date())
yearPart=datepart("yyyy",date())

If dayPart<10 Then
    dayPart="0"&dayPart
End If

If monthPart<10 Then
    monthPart="0"&monthPart
End If

reqDate=monthPart&"-"&dayPart&"-"&yearPart
msgbox(reqDate)
Reply


Messages In This Thread
Getting System Date in Checkpoint - by nilu verma - 06-18-2008, 01:18 AM
RE: Getting System Date in Checkpoint - by Ankur - 06-19-2008, 02:28 PM
RE: Getting System Date in Checkpoint - by siri - 07-17-2008, 11:41 AM
RE: Getting System Date in Checkpoint - by anemuday - 07-20-2008, 12:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Local System Monitor kbhargava505 0 2,429 10-16-2015, 12:52 PM
Last Post: kbhargava505
  QTP system related issue Bharathi Kanagarajan 1 1,986 09-12-2015, 11:28 PM
Last Post: ADITI1992
  System getting locked Anand Saboo 4 3,490 10-24-2013, 05:09 PM
Last Post: Anand Saboo
  Need Help Datatable Parameterzing Date debindas 1 3,448 08-30-2012, 11:43 PM
Last Post: QTPScript
  How To Select Date From a Calender Image Where Date field is non editable? RameshKrishnan 1 3,855 05-28-2012, 09:29 PM
Last Post: defcon3

Forum Jump:


Users browsing this thread: 1 Guest(s)