Sorry that there is something wrong with my previous formula, e.g. if logs out is 12:59PM and logs back in is 1:00PM.
This may correct:
=IF(A1<>A2,"",TIMEVALUE(LEFT(B2,LEN(B2)-2)&" "&RIGHT(B2,2))-TIMEVALUE(LEFT(C1,LEN(C1)-2)&" "&RIGHT(C1,2)))