Converting a date string in UFT
Category:
Question ID: 110124
0
0

I’ve been working with UFT for a few months now, and one thing that keeps coming up is having to convert a string to a date, then use that date later in the test. I’ve tried solutions I’ve found online, and I’ve got a method which can handle most date formats. However, I was wondering if you were aware of any utility or function that can be used when converting strings to dates? (The Monday, February 22, 2021 format is causing issues) Most of the solutions I’ve found when run in UFT come back with ‘expected end of statement’ just hoping you guys may have something to help me out here. – Thanks.

Marked as spam
Posted by (Questions: 227, Answers: 22)
Asked on April 29, 2021 12:44 pm
78 views
Answers (1)
0
Private answer

Have you looked at the VBScript function CDate? I think it might be what you are looking for. Here are a couple of tutorials:

https://www.w3schools.com/asp/func_cdate.asp

https://www.softwaretestinghelp.com/vbscript-date-functions-tutorial-8/

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on April 29, 2021 12:45 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top