Forum Discussion
Hello, I understand your application creates new record with ID string based on current date time (for example YYYYMMDDhhmmssSSS "20250108115133999") and you want to validate that it is the correct value.
Is that correct? can you provide your string format?
If my assumptions is correct, you can do that with writing code to generate a string based on current date time, read the record ID value and compare it with the string you generated. The challenge would be the time difference from when the record was created and when you generate your string. To overcome I suggest you skip the seconds and milliseconds, and perhaps also skip the minutes.
The following documentation can help you https://support.smartbear.com/testcomplete/docs/scripting/working-with/index.html
I agree with Hassan_Ballan,
First, the date/string format you get is a big factor. Without seeing the precise format, we can only speculate.
Second, checking for the exact time is a recipe for failure in my experience. As suggested, it would be more robust to skip at least everything after the minutes.
Third, a property checkpoint using a regular expression may be the way to go. That would give you greater flexibility over how you validate the value. See: Regular Expressions Syntax | TestComplete Documentation
Finally, there are aqDataTime methods that will let you extract the portions of the date/time you want and compare them. See: aqDateTime Object Methods | TestComplete Documentation