Brian Dunning's FileMaker Custom Functions

SecondstoTime ( seconds )

Convert seconds into time hh:mm:ss

  Average rating: 4.0 (3 votes) Log in to vote

Mark Lasswell   Mark Lasswell
WTVP
http://www.wtvp.org

Share on Facebook Share on Twitter

  Sample input:
SecondstoTime ( 1711 )
  Sample output:
0:29:31

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

Needed to convert total number of seconds into the hh:mm:ss format, wasn't able to find a function so I created my own.

 

Comments

Wouter Keja   Wouter Keja, Amersfoort
Mar 24, 2017
I think thhe function you were looking for is GetAsTime (...).
For 1711 it gives 00.28.31, by the way, but that must be a typo.
 
19752   19752, Japan
Mar 24, 2017
Or you can do it also as
Time ( 0 ; 0 ; 1711 )
 
Matt Minde   Matt Minde, Yellow Springs, Ohio
Jan 27, 2018
None of the formula above worked, but when I added "(GetAsText ( secondsfield ))" I got the proper result:

Time (
(Floor ( (GetAsText ( secondsfield )) /3600 )) ;
(Floor ( (Mod ( (GetAsText ( secondsfield )) ; 3600 ) / 60) )) ;
(Floor ( Mod ( (Mod ( (GetAsText ( secondsfield )) ; 3600 )); 60 ) ))
)

Thanks for all the help! On the shoulders of giants...
 
Matt Minde   Matt Minde, Yellow Springs, Ohio
Jan 27, 2018
Just realized this also works for the other formula:

Time ( 0 ; 0 ; (GetAsText ( secondsfield )) )
 

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 15 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:

Under construction. Email me your wish list for improvements.