This is working:
[day-from-dateTime(Date)=18 and month-from-dateTime(Date)=1 and year-from-dateTime(Date)=2018]
or this, but it's not very readable
A thought regarding this: in your original posting, you showed a specific date/time, i.e. midnight on 2017-07-21. In my experience, its pretty rare that a date time value matches an exact timestamp - which is what the date literal is converted to. So perhaps a range would work, i.e. >= 2017-07-21 and < 2017-07-22?
I think explicitly stating the date in the xpath converts it to a localized time (so UTC plus the offset of whatever timezone you are in), meaning the timestamps won't match.
Could you try creating a DateTime variable and using parseDateTimeUTC()? Using your string date and corresponding format and then using the variable in the xpath?
That would require a datasource microflow, and I don't know if this will fit your case, but you can use it to verify if that's really the problem.
Anyone have any ideas?
Bumping this to the top again. Is the answer simply that you cannot create an Xpath constraint with an explicit date?