Brian Dunning's FileMaker Custom Functions

Clock ( )

CF for displaying a running time in a webviewer

  Average rating: 3.8 (59 votes) Log in to vote

Don Wieland   Don Wieland - Show more from this author
DW Data Concepts
http://www.dwdataconcepts.com

Share on Facebook Share on Twitter

  Sample input:
Clock()
  Sample output:
1:47:25 PM

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

CF for displaying a running time in a webviewer (w97xh32). Uses javascript and CSS. Both can be modified to get the time to look differently.

 

Comments

zagino   zagino, Zagreb, Croatia
Oct 26, 2009
Does not work under Windows XP & fmp 10 A ???
 
Richard Hyams   Richard Hyams, Oceanside, NY
Oct 28, 2009
Asked Don twice over the past two weeks to briefly explain how this custom function can be implemented. Maybe he didn't receive e-mail. I hope he will see this note and explain how to implement this custom function.
 
Tara Ingram, Beezwax Datatools   Tara Ingram, Beezwax Datatools, Oakland, CA
Jan 26, 2010
Here is a revised version that is working for us on Windows. Windows uses IE to render WebViewer content, and Mac uses Safari.

Replace this:
document.getElementById(\"clock\").firstChild.nodeValue = currentTimeString;¶

With this:
document.getElementById(\"clock\").innerHTML = currentTimeString;¶

Thanks go to Alex Gibbons @Beezwax Datatools.
 
jj   jj, ny
Aug 5, 2011
this does not renders on iwp on IE.
 
Rich   Rich, Austin/TX
Dec 5, 2011
What would be the code addition to add the current date as well?
 
Sean Kelley   Sean Kelley, Westfield, NJ
Apr 18, 2013
How can I use the web viewer running clock in a calculation field? i'm trying to build a
backtimer and FM does not support a running clock function without using a script trigger.
 
Brian   Brian, Oxford/MI
Jul 30, 2014
Works great on FMPro 13 (Mac OS 10.9.4) Thanks a lot for this useful bit of code!
 
joe lewis   joe lewis, Burbank
Aug 10, 2018
How can I increase the size of the return text?
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: