You'll have trouble getting that time to update like a digital clock display but if you click a button at the start of the simulation to log the actual time, another button can add a new comment record and use the elapsed time to compute the simulation time and log it in a field in the same record.
You'll find it much more flexible to have multiple records with one record for each comment rather than multiple comments logged with different times all in one field. (This is a possibility suggested to me by what I see in your screen shot.) You may want to use a portal to a related comments table for logging them.
So would I create a button that is a time field, (in this case showing 14:00) and make it clickable?
Then when I create a new portal record it would put the time in the "Time" field by getting the time from the button above?
Am I headed in the right direction?
If you go the route of logging your comments in a different, related table, then add an auto-entry calculation resulting in time into a field called "Elapsed" on the comments table ( Comments::Elapsed ) where the auto-entered calculation = Get(CurrentTimeStamp) - $$StartTimeStamp.
When the simulation starts, program the "START" button to set the global variable $$StartTimeStamp as Get(CurrentTimeStamp).
Creating a new comment will automatically enter the a value in Comments::Elapsed equal to the total elapsed time in seconds.
This eliminates the need for a continuously running script. If you want the clock on the report to count-down, you will need to opt for a looping script to run the clock, but can still use the above-mentioned approach for actually calculating elapsed time on a new comment record.
Not sure if I got it right - but there are examples around using a webviewer with php code. Using a bit of 'svg'- commands, even an analog-clock is possible. Drawback is that this eats resources... cpu, battery..
I would vote for Michael Voccola's solution..
If You are interested in the php-webviewer-method: Just google for 'filemaker clock php'. It should be possible to show a running clock - and when the user takes any action that has to stop the clock, the time can be catched using 'get(SystemTime', etc.
Still having a bit of problem setting this up. I created a Start button which puts in a timestamp the field beside the Start Time Stamp. But instead of getting the current time it shows:
01/01/0001 12:00 AM
In the button setup I used the calculation: $$StartTimeStamp = Get(CurrentTimeStamp)
What I am trying to do is to use the Exercise Start time (in this case 17:00) and then when I put in a comment in the portal, it will use the Exercise Start time and calculate the difference between when I clicked Start and the 17:00. For example 17:09.
I would like it to show only the minutes between when I clicked Start and when I am trying to put in a comment.
Where have I gone wrong?
The start button has to write the current timeStamp into the StartTimeStamp field with a simple:
Set Field [ YourTable::StartTimeStamp ; Get ( CurrentTimeStamp ) ]
An OnObjectEnter trigger attached to the field "Comments" fires a script that put a time into the "Start" field; that script is:
Set Field [ YourTable::Start ; YourTable::ExerStartTime + ( Get ( CurrentTimeStamp ) - YourTable::StartTimeStamp ) ]
I've done as you have suggested and it worked perfectly ... until today. Yesterday it would show in the TimeSession field the time in hours and minutes, but today when I tried it I get a long number that isn't in the format of "hhmm".
I tried re-formatting the field TimeSession to show as time with the format of "hhmm", but I am still getting this number.
What have I done wrong?
Disregard the above. I figured out what I had done wrong. I made a new button but put in the wrong calculation in the field. Your answer was just what I needed.