is it possible to change the date format like MM/DD/YY
into DD/MM?YY through script in QTP

Answers were Sorted based on User's Feedback



is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP..

Answer / m kumar

Date function in qtp displays current system date as
MM/DD/YY,So change this in to DD/MM?YY format below is the
process
Strday = day(date)
Strmonth = month(date)
Stryear = year(date)
Newformat = Strday&"/"&Strmonth&"?"&Stryear

Is This Answer Correct ?    21 Yes 0 No

is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP..

Answer / guru

DD = Day(now)
If Len(DD) = 1 then
DD = "0" & DD
End If

MM = Month(now)
If Len(MM) = 1 then
MM = "0" & MM
End If

YY = Year(now)
YY = right(YY,2)

Date_Format = DD & "/" & MM & "?" & YY

Is This Answer Correct ?    9 Yes 0 No

is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP..

Answer / lak

Strday = day(date)
Strmonth = month(date)
Stryear = right(year(date),2)
Newformat = Strday&"/"&Strmonth&"?"&Stryear
msgbox Newformat

Is This Answer Correct ?    5 Yes 0 No

is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP..

Answer / maya

Dim years
years=inputbox("enter year as MM/DD/YY format")
x=mid(years,4,2)
msgbox x
y=left(years,2)
msgbox y
z=right(years,2)
msgbox x+"/"+y+"/"+z

Is This Answer Correct ?    4 Yes 1 No

is it possible to change the date format like MM/DD/YY into DD/MM?YY through script in QTP..

Answer / snehasis

oldFormate = "MM/DD/YY"
array=split(oldFormate,/)
newFormate = array(1)+array(0)+array(2)

Is This Answer Correct ?    9 Yes 8 No

Post New Answer

More QTP Interview Questions

regular expression

2 Answers   Wipro,


from where we will retrieve data for data driven tests in qtp?

3 Answers  


How to Analyze the Checpoint results by Standard Checpoint?

1 Answers  


There is one login screen,after accepting valid username and apassword, it will show the next screen. In the 2nd screen u r having 2 combo boxes, U have to select any item from these, and click OK button. After closing that, it will show the 3rd screen. If u click CANCEL button from 2nd screen it will show the first screen. Write QTP script for it???

1 Answers   Sonata,


Plz suggest me a good training institute in Mumbai/hyderabad for QTP…. Plz advice thank u

29 Answers   IBM,






What are the views available in quicktest professional (qtp)?

0 Answers  


what is mean by output parameters? I need full description with example. tell me any one please

1 Answers  


Hi, When iam trying to import sheet to the QTP Global data table at the run time using the Importsheet method.It is able to import the sheet but no data is present after the import due to which the test is failing.Could anyone suggest what should be done. When I open the actual excel sheet data is present and is not corrupted.

2 Answers  


In what situations QTP will not recognize the Objects?

6 Answers   Wipro,


What is a recovery scenario?

0 Answers  


How to get Links count in an web application,without descriptive programming?

8 Answers  


how can we retrieve ten rows from the data table using loop concept?

3 Answers  


Categories