:: DemoTime[public outdoors noEvents]
<!--
	public and outdoors this time.
	Look above for the meaning of this.

	You can see one effect of the combination of the public and the outdoors-tag here: the Wait-action is automatically added to the passage.
 -->

<h2>Time</h2>
<<imageDayNight 'locations/gadukino/forest/#.jpg' 'gadforest4' 'gadforest_night1'>>
<!--
	Similar to random images, the imageDayNight-macro replaces the # in the images path (parameter 1) with 
	the second parameter if it's daytime and
	the third parameter if it's nighttime.
	You can use the cheat menu to advance time to see the difference.
 -->

<<ConnectedLocation 'Leave' 'DemoMain' '' 'locations/construction/obekt.jpg' 5>>

<p>
	<<if $time.isWinter>>
		It's winter.
	<<else>>
		It's not winter.
	<</if>>
	<!--
		This executes one branch depending on whether it's currently winter.
		That's most commonly used to decide which image to display, but it could also, like here, be used to change text or to execute other saison-dependent code.
	 -->
	We are at daystage <<=$time.dayStage>>.
	<!--1 - dawn
		2 - midday
		3 - sunset
		4 - the beginning of the night
		5 - night
		6 - the end of the night
	-->
</p>

<p>
	Current time (h:m d.m.y): <<=$time.hour>>:<<=$time.minutes>> <<=$time.day>>.<<=$time.month>>.<<=$time.year>> (day <<=$time.weekday>> of the week).
	<!--
		These are the time-informations you'll need most of the times.
	-->
	Or, in short: <<=$time.dateTimeString>>.
	<!--
		Use this if you need to display the current time.
	-->
</p>

<p>
	It is day <<=$time.daystart>> of your current game.
	<!--
		This number is oftentimes used by scripts to determine how long it has been since something happened.
		For example, the school uses this number (comparing it with the day of your last presence) to determine how long you have been absent from school.
	 -->
</p>

<p>
	Only <<=$time.daysDifference(24,12,-2)>> days til X-mas!
	<!--
		Set the year to -2 to get the next occurence of the date (-1 would be current year and could therefore result in negative numbers).
	-->
</p>

<<act 'Wait 10 minutes'>>
	<<addtime 10>>
	<<refresh>>
<</act>>
<!--
	The addtime-macro adds the specified minutes to the current time.
	The system takes care of everything you don't want to worry about, such as sleep, hunger, thirst, timed events, etc.
 -->

<<act 'Wait til 06:00'>>
	<<run $time.advanceTo(6,0,true)>>
	<<refresh>>
<</act>>

<!--
	No need to calculate if you want to wait til a certain time.
	Keep in mind that the time passes for your character as well.
	She will most likely become hungry, thirsty and sleepy.
	If parameter three is not set to true, this script will silently fail if it's past the given time.
-->

<<cooldown 'demoCooldown' 15>>
	<p>
		You can only see me every 15 minutes.
	</p>
<</cooldown>>
<!--
	The cooldown-macro executes it's code and then deactivates itself for the given number of minutes.
	The first parameter needs to be a unique identifier.
	You can test the code above by hitting the "Wait 10 minutes"-action several times.
	You will see the text only every second time.
	As with other macros, any kind of code could be included inside the cooldown-macro.
 -->

<<onceADay 'demoOnceADay'>>
	<p>
		You can only see me once a day.
	</p>
<</onceADay>>
<!--
	Similar to cooldown, onceADay only executes once a day.
	You also need to use a unique identifier as a parameter here.
 -->

