example-date format is 01-jan-09 in QTP.How to convert this
format to 01-01-09?

Answers were Sorted based on User's Feedback



example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / saravanaraja

Balaji First you understand the question.

Ex: 01-jan-09 in QTP. How to convert this
format to 01-01-09?

MsgBox date. This is simple to view the Current date.

They asked How to convert 01-jan-09 TO 01-01-09.

Is This Answer Correct ?    14 Yes 3 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / brahma naidu kapa

It's very simple question;
no need to write all the excessive code.
Please convert the given value into date format by using
the CDATE Function

val = "01-jan-09"
Conv_Val = cdate(val)
msgbox Conv_Val

Result : "01-01-2009"

Is This Answer Correct ?    13 Yes 5 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / kiran kallepu

please find below code
givenDate = "01-jan-09"
DD = Day(givenDate)
msgbox DD
MM= month(givenDate)
msgbox MM
YY=year(givenDate)
msgbox YY

sysdate=DD&"-"&MM&"-"&YY
msgbox sysdate

Is This Answer Correct ?    8 Yes 4 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / swati

I could not find any straight way to do this, however it
had to be done in a customized manner:

newDate = day(date) & "-" & month(date) & "-" & year(date)

Is This Answer Correct ?    6 Yes 5 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / pratatp

i also not find the straight way.
dat=datevalue("01-jan-09")

d=day(dat)
m=mon(dat)
y=year(dat)

con_dat=d&"-"&m&"-"&right(y,2)

msgbox con_dat

Is This Answer Correct ?    2 Yes 2 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / harish

val = "01-jan-09"
Conv_Val = cdate(val)
msgbox Conv_Val

newvalue = replace(Conv_Val,"/","-")


values = split(replace(newvalue,right(newvalue,4),right(newvalue,2)),"-")

for i = 0 to ubound (values)

if Len(values(i)) <2 then
temp = temp & "0" & values(i) & "-"
Else
temp = temp & values(i)
End If
Next

msgbox temp

'Result : "01-01-09"

Is This Answer Correct ?    0 Yes 0 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / balaji

Hi You Can Use This Code

DD= Day(now)
msgbox DD
MM= month(now)
msgbox MM
YY=year(now)
msgbox YY

sysdate=DD&"-"&MM&"-"&YY
msgbox sysdate

Is This Answer Correct ?    8 Yes 10 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / rajendra

Please find code below:

'get date
StrDay=Day(now)
'get Month
StrMon=Month(now)
'get Year
'Stryear=year(now)

' Assemble the Date according to the ur requirement ( ex:01-
01-2010)
ExpDate=StrDay&"-"&StrMon&"-"&'Stryear
msgbox ExpDate

Is This Answer Correct ?    1 Yes 4 No

example-date format is 01-jan-09 in QTP.How to convert this format to 01-01-09?..

Answer / vishakha b

If you are talking about some date value in global sheet,
here is the procedure:
Select the entire column where the Date is put in the
format: 01-jan-09
Right click, go to Format => Custom Number. Select 'Date'
under 'Category' and type the format you want into 'Type'
text box. Click 'OK'

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More QTP Interview Questions

what is selective recording ? and normal recording?

1 Answers   iSoft,


How to identify the child window. In my case while recording, When i open new window and give checkpoint for some control and when i run that script QTP give error like" can not identify the object" Is there any method or solution to handle child window issue Note: In my apllication i have to check child window of child window also ( multiple windows open )

2 Answers   Infovision,


WHat is Object Identification and Object Spy?

2 Answers   IBM,


what is descriptive.create()in qtp?

3 Answers  


WHAT IS SMATR IDENTIFICATION? plz EXPLAIN BRIEFLY? IS IT POSSIBLE in QTP? HOW AND WHEn THE SITUATION U R USING EXPLAIN WITH EXAMPLE?

3 Answers  






how to do regression testing in qtp? plz give ans with examples

6 Answers   TCS,


How will you check that your test cases covered all the requirements?

0 Answers  


1. Which function is used to check whether the specified object property achieves the specified value within the specified timeout below anyone is correct 1. Check Property 2. getToproperty 3. output Pls anybody can give the answer.. Thanks in advance...

1 Answers   Navis,


What is the standard timing delay for web based application in qtp?

0 Answers  


I have a Webedit object. some text is entered in that object I want to know the font sixe of that text.How could I do this using QTP? This is a requirement for me. I am happy if any one help on this

3 Answers   GE,


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, and also tell me the best institute and the estimate cost for joining the institute ib delhi NCR. Hence, if possible, kinldy mail PDF file to my mail-ID: kumar123.pathak@gmail.com , Regards, kumar pathak

0 Answers  


what are the disadvantages of qtp? can linux support qtp9.2? how could get web address throu vbscript?

6 Answers   Quintegra,


Categories