Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi Guys,

I have a web viewer which is simply a clock. I have looked over the forum for the solution but can not seem to get my head around where to retrieve what I want which is - the current time sent to a variable.From what i can gather - you have to use a left, middle etc in a calc to return the value ( or thats what i am assuming) my issue is where and how?. Here is the detail inside my webViewer:

"data:text/html,

 <html>

 <head>

<script language='javascript' type='text/javascript'>

function displayClock() {

 var digital = new Date();

 var hours = digital.getHours();

 var minutes = digital.getMinutes();

 var seconds = digital.getSeconds();

 var amOrPm = 'AM';

 if (hours > 11) amOrPm = 'PM';

 if (hours > 12) hours = hours - 12;

 if (hours == 0) hours = 12;

 if (minutes <= 9) minutes = '0' + minutes;

 if (seconds <= 9) seconds = '0' + seconds;

 dispTime = '<b>'+hours + ':' + minutes + ':' + seconds + ' ' + amOrPm+'</b>';

 document.getElementById('time').innerHTML = dispTime;

 setTimeout('displayClock()', 1000);

 }

</script>

 </head>


This returns nicely on the screen as the correct time. If I use the GetLayoutAttribute content i get the above show up in a test dialog box. What I want is the result of the above i.e. the time. Any ideas on where the calc should be looking for the result?

cheers

9 minutes ago, Peter Barfield said:

where to retrieve what I want which is - the current time sent to a variable.

Why don't you simply use the Get ( CurrentTime ) function, which gets the current time directly from the system clock, without needing a web viewer.

  • Author

Comment that is a fair question and usually that would be the case however, in this instance 4 Terminals will be in use and for audit and session consistency this way in my thinking appears more accurate. If one of the terminals which are being used has an incorrect time then it wont marry up with the others or worse still if heaven forbid they were all running on different time then that would be disastrous. Hope this makes sense and I hope i am understanding the use of Get(CurrentTime) Function as returning the time as specified on the current machine. Thus the web viewer option to be "universal amongst all machines".

Cheers,

6 hours ago, Peter Barfield said:

I hope i am understanding the use of Get(CurrentTime) Function as returning the time as specified on the current machine.

Yes, it does. And so does your clock in the web viewer.

 

6 hours ago, Peter Barfield said:

in this instance 4 Terminals will be in use and for audit and session consistency this way in my thinking appears more accurate. If one of the terminals which are being used has an incorrect time then it wont marry up with the others

I am not sure what you mean by "terminals". If your solution is hosted, you can use Get ( CurrentHostTimeStamp ) to get the host's timestamp. If not, you'll have to get the clock from some external source - perhaps by importing it from a web service or inserting it from a URL.

 

 

Edited by comment

  • Author

OK so I have misunderstood the clock issue by the looks of it. I assumed that the time in the web viewer was from a URL. As that is what the instructions I had at hand implied. (it's a good day as I have learnt something new). Yes it will be hosted and at that point you would be correct I could use the  Get ( CurrentHostTimeStamp )  i actually had missed that as an option in the functions and thus thought it was only relevant to the current machine. Think I will turn to the right and head down that path you have pointed me in. Thanks for the clarity much appreciated.

2 hours ago, Peter Barfield said:

it's a good day as I have learnt something new

That's my motto, too (under different spelling, though ;)).

This, BTW, is an excellent example of the XY problem.

 

 

Edited by comment

I have taken some of these wrong paths myself.  Excellent link, Comment.  :-)

  • Author

Thanks comment. Fantastic link had a chuckle to myself as yes sometimes I am so guilty of not taking the foot off the pedal and  standing back and reassessing the problem or situation my wife also say's i am guilty of just assuming that what is going around in my head should be going around in everyones head and so I often don't explain myself because of said assumption.- I just try to plough on like a bull at a gate. It's just my pig headedness to not lose at anything that does it. Albeit, yes I often lose much to my disgust. :-)  Thanks for the "gentle reminder" appreciated.

Cheers

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.