ST has time beacons across the quadrant (there's an episode that was on TNG a few weeks ago where the Enterprise was caught in a time loop, and when they got out they had to re-synchronize with the nearest Federation Time Beacon.) to keep all the ships in relative time to Earth. (Since warp travel involves travelling faster than light, the ship itself keeps their own time and then re-synchronizes when coming out of warp with a Time Beacon)
Earth uses 24 hours because of it's orbit time / cycle around the sun. Bajor's of course is different so since the DS9 station is Bajoran officially, it runs on 26 hour time. The official use is 24 hours, and shifts are rotated around the clock - morning shift, day shift and night shift... some characters have purposely taken night shifts (Ensign Kim - Voyager, Lt Data - TNG) in order to assume and learn higher ranking positions and advance their careers, but I digress.
Just in Time..
--Matt²