Hi I need a help to create a macro to calculate start time and end time

If I enter any value in Cell A1, B1 should populate time and If I enter value in C1,D1 should populate end time

Only challenge what I am facing is If I type something in Cell A1, B1 populates the time but if i delete the content in A1 It should delete the time in B1