How to compare two date string in a date format
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021
09:51 PM
01-27-2021
09:51 PM
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
Solved! Go to Solution.
Labels:
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021
10:48 PM
01-27-2021
10:48 PM
Here's how to convert a string to a date using javascript
Here's how to compare the dates using javascript
Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
