Time-reversal symmetry, microcavities and photonic crystals