Another way could be using requirements.
Make a dummy unit. Find your spell in object editor and in the "Techtree - Requirements" add that dummy unit.
Then, when someone chooses this hero (whose abilities you want to limit by time of day) you create that dummy unit in map.
Then use simple trigger: When in-game time of day is "your desired night time", change owner of that dummy unit to owner of the hero.
When time becomes "your desired day time", you change owner of dummy to neutral passive.
This will disable hero's ability, as long as that dummy is not controlled by same player as hero.
Example: I named this dummy unit "Night time" and did exactly what I wrote above.
So when it's day time and I hover over that hero's ability (e.g. Sleep), it will be disabled with this written in it:
Requires:
- Night time
Note that the Night time written there is actually the name of the dummy unit
I used this technique to limit Dreadlord's Sleep ability. Look at hidden pic: