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 - Show more from this author
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: Feb 10, 2022 Replaced function for a more robust version.

 

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.

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: