[i7][SOLVED] Time of Day display question

Hello guys,

Hope you can help me out here. I have had a difficult time trying to find any solution to this anywhere online.

I have a new sleeping command showed here:

Understand the command "sleep" as something new.

New sleeping is an action applying to one number.

Understand "sleep [a time period]" as new sleeping.
		
Carry out new sleeping: 
		increase the time of day by the time understood;
		decrease the time of day by one minute.
		
Report new sleeping:
	say "You sleep until [time of day + 1 minute].".

Things work correctly until the you sleep past midnight. If the time of day passes midnight, the time of day shows oddly.

For example, if you sleep for 8 hours beginning at 5:00 pm you get the result:

>sleep 8 hours
You sleep until 13:00 pm.

If I make any kind of reference to displaying the time of day during the new sleeping action, it results in this odd after midnight display. Once the new sleeping action is done and I do another action displaying the time of day, it will properly display the time as 1:00 am.

Any insight would be greatly appreciated.

This is an old bug: inform7.com/mantis/view.php?id=441

Avoid this by using the phrases “(time) after (time)” and “(time) before (time)” to do time computation.

	let T be the time understood after the time of day;
	now T is one minute before T;
	now the time of day is T;
	say "You sleep until [one minute after the time of day].".

Thank you zarf.

I modified the code with the suggestions and, of course, it works perfectly now. I guess my searches on this problem were not accurate enough to pull it up as an old bug as I never came across it and I knew it would be something fairly simple.

Again, thanks for the quick response. It is greatly appreciated.