It's very easy, just use a spell that summons a unit (eg. Dark Portal) make it summon a wisp or something, and make a trigger like this:
Events
--A unit enters (playable map area)
Conditions
--Entering unit type is equal to (wisp, or whatever unit you're using)
Actions
--Remove (entering unit) from the game
--Change time of day to 24.00 (or whatever time you want to change it to)
I recomend using a custom unit or a unit that can't be used on your map for the summoning so the trigger won't run every time you train that unit.