Changing date format in UFT
Category:
Question ID: 110061
2
0

I have Date field that is a WebEdit object Object Property Value is formatted as 2021-01-29 (YYYY-MM_DD). How would I change format to 01/31/2020?

Marked as spam
Posted by (Questions: 386, Answers: 64)
Asked on January 29, 2021 5:56 pm
116 views
Answers (1)
2
Private answer

You could use the .GetROProperty method on the WebEdit to get the current value and then use VBScript code to change the format. For example:

myDate = CDate("2020/02/01")
newDate = FormatDateTime(myDate)
MsgBox newDate

Here's info on GetROProperty.

Here's info on VBScript Date formatting.

Marked as spam
Posted by (Questions: 16, Answers: 807)
Answered on January 29, 2021 6:00 pm
0
That worked really well, thanks for the example
( at January 29, 2021 6:01 pm)
EyeOnTesting

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

X
Scroll to Top