How do you get the moment your script has started to run?
The runtime system of Ampersand contains a function that produces the current date. Here is an example how to use it:
If you run this program, this is what you'll see
The rule "Initialize today's date" tells us that there must be a date for every session. When your session starts, there is a session atom: _SESSION
. The relation sessionToday
does not relate that session atom to a date, so the rule is violated. As a consequence, the ExecEngine triggers the violation and calls the function SetToday
. That PHP-function creates the desired link in the relation sessionToday
. That is then displayed in the user screen.