VS Magicdate string with escape char is not working in DevTest 10.3 or newer
searchcancel
VS Magicdate string with escape char is not working in DevTest 10.3 or newer
book
Article ID: 106332
calendar_today
Updated On: 10-16-2023
Products
CA Application TestCA Continuous Application Insight (PathFinder)Service Virtualization
Issue/Introduction
The below Magic date string is not working in DevTest 10.3 and newer versions but same is working fine in previous versions {{=doDateDeltaFromCurrent("yyyy-MM-dd'T'HH:mm:ss.sss'Z'","0H");/*2017-06-05T11:47:58.801Z*/}}
Environment
All supported DevTest versions
Cause
In the previous versions of DevTest it was parsed differently. The change was made to fix issues relating to timezone and differences between using z and Z. Java's SimpleDateFormat parser will not parse with the sss for milliseconds as in yyyy-MM-dd'T'HH:mm:ss.sss'Z' .
The parser wants minutes.seconds.milliseconds
mm -> minutes ss -> seconds SSS -> milliseconds.
Resolution
Change the date pattern: yyyy-MM-dd'T'HH:mm:ss.sss'Z' to yyyy-MM-dd'T'HH:mm:ss.SSS'Z