Let's assume the following...
A2:A15 contains the date
B2:B15 contains the time
C2:C15 contains the 1
If B1 can remain empty, try...
D2:
=COUNT(C2:C15)
E2, copied down:
=IF(ROWS($E$2:E2)<=$D$2,INDEX($B$2:$B$15-$B$1:$B$14,SMALL(IF($C$2:$C$15=1
,ROW($C$2:$C$15)-ROW($C$2)+1),ROWS($E$2:E2))),"")
....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
If B1 contains a column header and can't remain empty, try...
D2:
=COUNT(C2:C15)
E2, copied down:
=IF(ROWS($E$2:E2)<=$D$2,SUM(N(OFFSET($B$2:$B$15,SMALL(IF($C$2:$C$15=1,ROW
($C$2:$C$15)-ROW($C$2)+1),ROWS($E$2:E2))-{1,2},0,1))*{1,-1}),"")
....confirmed with CONTROL+SHIFT+ENTER.
Hope this helps!