How to parse "Do you have the time?" correctly

Solution 1:

I don't think the problem is parsing. I'd guess that you understand that this is an interrogative statement with the third person singular subject, with the auxiliary do coming before the subject, followed by a present tense and active voice verb, then a direct object, and so on.

What you're not used to is idiom. The first consideration is the association of have and know. We say

I have an idea. (I know something.)
I have the answer. (I know the solution.)

The second consideration is the [ellipsis], i.e., the words left out:

Do you have the time [on the clock]?
Do you have the time [of day]?

The third consideration is that the time serves double idiomatic duty as a moment of time (as in the examples above) and as an indeterminate interval of time as in the examples below:

Do you have the time to help me?
In the time it took you to complain about the task, you could have completed it.

This means that the request for "the time" automatically has two idiomatic meanings, and native speakers will use the context to determine which to use. They may be serious and choose the moment meaning:

Q: Do you have the time?
A: Sure, it's 4:56 PM.

or they may be facetious and pretend to choose the interval meaning:

Q: Do you have the time?
A: Sure, if you have the inclination.

As the second, jokey example shows, your awareness of the two grammatical usages is perfectly normal. Matching the right usage to the right situation is a matter of practice.