Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DateFormat help
#5
Solved: 12 Years, 10 Months, 3 Weeks ago
Hi,

You can try with the below ways:

Way1: Use FormatDateTime built-in function ( Refer the QTP help file for more info.)

Way2: Refer the below code

Code:
x="May 31 2011"
     Dpart=DatePart("d",x)    
     Mpart=DatePart("m",x)    
     Ypart=DatePart("yyyy",x)  
    
     If Dpart<=9 then
         Dpart="0"&Dpart
     End if  

     If Mpart<=9 then
         Mpart="0"&Mpart
     End if  

     RequiredDateVal=Ypart&"-"&Mpart&"-"&Dpart
     Msgbox RequiredDateVal

Reply


Messages In This Thread
DateFormat help - by AutomationTester2011 - 05-31-2011, 12:54 PM
RE: DateFormat help - by manabh - 05-31-2011, 12:55 PM
RE: DateFormat help - by AutomationTester2011 - 05-31-2011, 01:03 PM
RE: DateFormat help - by vIns - 05-31-2011, 01:25 PM
RE: DateFormat help - by sreekanth chilam - 05-31-2011, 01:25 PM
RE: DateFormat help - by vIns - 05-31-2011, 01:26 PM
RE: DateFormat help - by AutomationTester2011 - 05-31-2011, 03:51 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)