Let's say you go up to a group of people in the street and want to ask them the time; which of the above two sentences is the more appropriate? (are there any better alternatives)
Neither is perfect - I would normally expect: "Have any of you got the time?", which is a bit of a mixture of both your examples.
I think that your examples work, even though they are not perfect as another user pointed out.
I think that
Could you please tell me what the time is?
is better, but I believe that it is a matter of preference.