0 votes
by (370 points)
I know how to make a clock for my game but when i change date to tomorrow the clock still show the hour of yester day.Is there any way  to make it turn to 7am whenever the date is changed?

I use sugacube

1 Answer

+1 vote
by (44.7k points)

You just have to change the time in addition to the date.

You don't mention how your time system works, so assuming you're using a JavaScript Date object, then you would do something like this:

<<set $CurDate.setDate($CurDate.getDate() + 1)>>
<<set $CurDate.setHours(7)>>
<<set $CurDate.setMinutes(0)>>
<<set $CurDate.setSeconds(0)>>

That will advance the day by one, and set the time to 7AM.

Hope that helps!  :-)

 

...