Date format based on Workstation format

On Windows, and possibly other os’s, Chrome takes the format of a date from the OS settings. Where one user will have MM/dd/yyyy, another could have yyyy/MM/dd. How do we get the current required format. Now, we can run the tests on one workstation with a given format, but it will fail on another.

I researched on the web, and tried various suggestions, but no luck.

It may be difficult to get Windows date format in Java. You can introduce a new global variable called MachineDateFormat, which would be specific on every your test workstation.

How about developing a custom keyword that verifies a date matching with 2 formats (MM/dd/yyyy and yyyy/MM/dd). If either of them matches, return true. If both do not match, return false.