Why have I been having hacking cough in the morning & @ night but not during the day?

Consider this. Acid reflux or post nasal drip. An easy experiment would be to take Prilosec otc daily for a week or two (assuming no contraindications) and if the cough improves, reflux may be your culprit. Otherwise, you might have allergies triggering post nasal drip...See your doctor.
Possibilities... Cough can have many causes. Morning and at night brings a couple of ideas to mind. Could you be allergic to something in the room where you sleep that you are not exposed to during the day? Or, could you have post-nasal drip that results in a cough when in the supine position? I think an evaluation by your physician is needed to figure out the etiology and treatment plan.