I would say that you are not measuring the value of the data you want to know
abut.
If you want to know “how long was the light on for?” then you should record
when the light is on (and when it is off). Depending on how accurately you
want the answer to “how long was the light on for?” to be (hours, minutes,
seconds?) then you should record whether the light is on with at least twice
that resolution (in other words, if you want an answer accurate to the nearest
hour, you record whether or not the light is on every 30 minutes; if you want
an answer accurate to the nearest minute, you record every 30 seconds, etc).
The important point is that because you want to know how long the light was on
for, you record “whether the light is on”.
If instead you record “when did the light get turned on or off?” then you can
only answer “did the light get turned on (or off) during this time period?” and
that is not the question you are ultimately trying to answer.
You have to record the data you need in order to answer the question you want.