Brian Dunning's FileMaker Custom Functions

TimeCorrect ( TimeEntry )

Enter time in a time field with or without colons (:) and convert to valid time

  Average rating: 4.4 (7 votes) Log in to vote

Menno van Beek   Menno van Beek
Van Beek Zakelijke Software
https://www.vbzs.nl

Share on Facebook Share on Twitter

  Sample input:
TimeCorrect ( 023 )
TimeCorrect ( 15 )
TimeCorrect ( 537 )
TimeCorrect ( 11:15:30 )
TimeCorrect ( 1630 )
TimeCorrect ( 8 )
TimeCorrect ( 34:30 )
  Sample output:
0:23:00
15:00:00
5:37:00
11:15:30
16:30:00
8:00:00
10:30:00

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

Very simple function to give users the ability to enter times like 925 instead of 9:25. This can be used in script or as auto-entry option in a time field or in calculations and scripts.

EDIT: Sept 28, 2018 with previous version 24:00 would be entered as 0:00
EDIT: Nov 02, 2018 in windows, when only hours were entered, they could sometime be treated as seconds. "TasN" makes sure that 1 or 2 digits never be treated as seconds.

 

Comments

jmmiro   jmmiro, Aprodisca
Sep 28, 2018
molt útil, gràcies
 
jmmiro   jmmiro, Aprodisca
Oct 9, 2018
Solo funciona si el campo es de texto, si el campo es de hora, los calculos son incorrectos
 
Menno van Beek   Menno van Beek, Van Beek Zakelijke Software
Oct 9, 2018
@jmmiro: With a system set to English or Dutch it works fine, so you may have to tweak the function a bit to accomodate for the Catalan language. A few examples would help to understand your exact issue
 
jmmiro   jmmiro, Aprodisca
Oct 9, 2018
Rectifico mi comentario anterior funciona bien dependiendo de la configuración de la hora del sistema
 
Menno van Beek   Menno van Beek, Van Beek Zakelijke Software
Oct 9, 2018
@jmmiro: With a system set to English or Dutch it works fine, so you may have to tweak the function a bit to accomodate for the Catalan language. A few examples would help to understand your exact issue
 
Menno van Beek   Menno van Beek, Van Beek Zakelijke Software
Oct 9, 2018
@jmmiro: in which setting is it then? How is a timeentry in that language look like?
 

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.

Under construction. Email me your wish list for improvements.