cancel
Showing results for 
Search instead for 
Did you mean: 

How to compare two date string in a date format

SOLVED
nedbacan
Contributor

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.

 

Compare.jpg

 

DATE STRING 1

Date1.png

 

DATE STRING 2

Date2.png

 

 

@BenoitB

1 ACCEPTED SOLUTION

Accepted Solutions
Marsha_R
Community Hero

Re: How to compare two date string in a date format

1 REPLY 1
Marsha_R
Community Hero

Re: How to compare two date string in a date format

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors