The fluctuation theorem is a pivotal result of statistical physics. It quantifies the probability of observing fluctuations which are in violation of the second law of thermodynamics. More specifically, it quantifies the ratio of the probabilities of observing entropy-producing and entropy-consuming fluctuations measured over a finite volume and time span in terms of the rate of entropy production in the system, the measurement volume, and time. We study the fluctuation theorem in computer simulations of planar shear flow. The simulations are performed by employing the method of multiparticle collision dynamics, which captures both thermal fluctuations and hydrodynamic interactions. The main outcome of our analysis is that the fluctuation theorem is verified at any averaging time provided that the measurement volume exhibits a specific dependence on a hydrodynamic time scale.