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

what r the 3 basic factor on which we determine to perform automation

6 Answers   AppLabs,


What are the advantages of Object Repository?

0 Answers  


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

3 Answers  


What is the difference between functional spec. and Business requirement specification?

5 Answers  


explain virtual object? in detailed? pls any one explain me?

4 Answers   Cap Gemini,






can u write Script to do Data Driven Testing throuh Externel & internel XL Sheet

2 Answers   Relq,


How does quicktest professional identifies the object in the application?

0 Answers  


QTP is identifying all windows application objects(i.e. winbutton,winconbobox,etc) as winobjects.How to handle this? Is there any way to add our own properties to identify objects?

1 Answers  


Which company is better amdocs or techm ???

2 Answers  


what is Defect density, defect leakage, defect age,latentbed,yasid testing, interface

4 Answers   Syntel,


Hi Recently I Attend one interview .The intervier ask on Question in QC 9.2 . The Qus was while ruuning the Batch RUNS scripts in test lab if defect will comes .The defect automaticly wants to genate . How to Configure in QC . Thank You Balaji

0 Answers  


How did you achieve reusability via QTP?

1 Answers  


Categories