UiPath Automation Developer Professional v1 — Question 71

A developer extracts a date from an email. The date will always be in the same format and always from the past. Some examples of this format are: “3 Mar 2023”, “20 Nov 2021”. The name of the variable where the date is saved is DateString. What expression should the developer use to check if the extracted date is within the last 7 days?

Answer options

Correct answer: C

Explanation

The correct answer is C because it accurately parses the DateString and checks if the difference in days from the current date is less than 7. Option A has the correct logic but uses an incorrect date format. Option B adds an unnecessary adjustment of -7 days, which complicates the calculation. Option D is incorrect as it improperly attempts to parse the subtraction of a string from a DateTime object.