Change Date Format using DotNetFactory
I know that UFT does not have any built-in function to simply change date format to the desired format unlike VBA function Format(Expression,Format) hence I'm using DotNetFactory to do it.
I had some luck running it for first couple of times but now I'm running into following error. I would appreciate if anyone could help.
Function DateManipulate(sDate) Set MyDate = DotNetFactory.CreateInstance("System.DateTime") Set oDate = MyDate.Parse(sDate) DateManipulate = oDate.ToString("yyyy-MM-dd") Set MyDate = Nothing End Function
Re: Change Date Format using DotNetFactory
I did some more debugging with the code and found that UFT is storing sDate in Datatype = Date which is not recognized by the.parse parameter as it is looking for a String Data type.
Any work around that?