Converting a date string in UFT
Question ID: 110124

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
Answers (1)
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:

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

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

Scroll to Top