Power = (work) / (time)
Work = (power) x (time)
= (4 watts) x (8 hours)
1 "watt" = 1 joule/sec .
Work = (4 joule/sec) x (8 hours) x (3,600 sec/hr)
= (4 x 8 x 3,600) joules = 1,024 joules .
==================================
Another way:
4 watts = 0.004 kilowatt
Work = energy = (power) x (time)
= (0.004 kw) x (8 hrs) = 0.032 kilowatt-hour .