Sounds like you have a switch leg where there is no neutral present....probably only one cable coming into the box.
While this saves cable(copper is expensive), it does present problems like this sometimes. You may be limited in the types of timers you can use because of this. Maybe John T will have a suggestion other than getting another cable/neutral to the switch box.
While I've not installed timers in a while, there are probably more options today than some years back....now, they are probably Bluetooth and you can program from your phone! I never cared for the programmable ones.....I would spend more time trying to figure it out than actually installing it!
Good luck!