Justin Bieber's gonna have to take time out of his busy world tour schedule to deal with a lawsuit ... according to a judge's order.
Bieber's legal team hasn't been able to agree on a deposition date in the lawsuit a photog filed, claiming Justin's bodyguard locked him in a Miami Subway restaurant and beat him up for taking pics.
According to docs, Bieber is unavailable from February 16 through December 2 due to a CA lawsuit he's dealing with, and because his "Purpose" world tour runs during that time.
Justin did say he had 2 free days in February, but the timing didn't work for the other side.
The judge sided with the photog and ordered Bieber to sit for questioning no later than July 31. He happens to have a tour stop in Miami on July 2.
Biebs might be a little depo-phobic since he's going to be grilled by Mark DiCowden -- the same lawyer who questioned him about Selena Gomez for a different case.