No need to quote my post in your reply...

I assumed you were running on a French configuration so I used ; delimiter as opposed to , as we would use here in the UK

UK settings:

C2:
=IF(B2>A2,MIN("22:00",B2)-MAX("06:00",A2),MAX(0,B2-"06:00")+MAX(0,"22:00"-A2))
copied down

D2:
=MOD(B2-A2,1)-C2
copied down