Brian Dunning's FileMaker Custom Functions

ElapsedTime_CFpub ( tsStart ; tsEnd )

Elapsed Time in Years, Months, Days, Hours, Minutes and Seconds

  Average rating: 4.2 (33 votes) Log in to vote

James Hea   James Hea - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
ElapsedTime_CFpub ( 10/15/2007 11:30 PM , 10/24/2007 6:57:58 PM )
  Sample output:
0 years 0 months 8 days 19 hours 27 minutes 58 seconds

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

Function: ElapsedTime_CFpub ( tsStart ; tsEnd).
Type: Timestamp calculation returning a text result.
Purpose: To calculate in human readable form the elapsed time between two events using years, months, days, hours, minutes and seconds.
Constraints: The function uses 30 days for months and 12 months for years resulting in a 360 day year.
Options: The function can be rewritten without the years and months and is perfectly accurate for elapsed time vs calendar time.
Modifications: The function can have a third parameter to extract any one time period value or to supply the text form.
Author: James Hea
Email: jhea@mac.com

 

Comments

Lee Smith   Lee Smith
Feb 4, 2010
This CF makes me a year older than I am?
 
Edward Souza   Edward Souza, Sao Paulo, Brazil
Feb 11, 2010
Lee, perhaps the date on your birth certificate is wrong. :)
Actually, you are right. I got some weird results when using this CF, so I re-wrote it.
Cheers.
 

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.