Forum Discussion

nedbacan's avatar
nedbacan
Frequent Contributor
4 years ago

How to compare two date string in a date format

  I have two captured date strings (see Object Spy screen) that I need to be compare and report to the log file,  if "date1" is greater than "date2"  the test pass and if not the test failed.  

 

See the screenshots below, the string date1 for image1 should be compared to the string date2 from image2, the expected result is that the newer image is displayed above the older image.  

 

Can someone show an example in Javascript how it should be written, learning from a sample is best  

 

I assumed the method aqConvert.StrToDateTime(S) should be used.

 

 

DATE STRING 1

 

DATE STRING 2

 

 

@BenoitB