Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5889 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hey,

I'm trying to format a date calculation and I'm a bit stuck. I'm trying to track the number of days, hours, minutes it took for a project to be completed. I used ProjectFinishedTimeStamp - ProjectStartedTimeStamp. The calculation Result is TIME.

How do convert the result of 6557:17:39 into 'D' days :) 'H' Hours : 'M' Minutes?

Much appreciated,

P

Posted

Have you looked at the custom Functions on Brian Dunnings site?

http://www.briandunning.com/filemaker-custom-functions/list.php

You may find what you need there.

Posted (edited)

Here's one possible way:

Let ( [

diff = GetAsTimestamp ( ProjectFinishedTimeStamp - ProjectStartedTimeStamp ) ;

days = Day ( diff ) - 1 ;

hours = Hour ( diff ) ;

minutes =Minute ( diff )

] ;

days & ":" & hours & ":" & minutes

)

The result must be Text.

---

EDIT:

Oops, I have accidentally omitted an important part of my post.

The above formula is a convenient shortcut, but it is limited to periods of less than 31 days. If the elapsed period may exceed this limit, it's necessary to move to a slightly more cumbersome (but always correct) version:

Let ( [

diff = ProjectFinishedTimeStamp - ProjectStartedTimeStamp ;

days = Div ( diff ; 86400 ) ;

hours = Div ( Mod ( diff ; 86400 ) ; 3600 ) ;

minutes = Div (Mod ( diff ; 3600 ) ; 60 )

] ;

days & ":" & hours & ":" & minutes

)

Edited by Guest
Posted

Thank you Comment.

I was stuck on how to break down the seperate numbers from days:hours:minutes. The Div and Mod works great. Thanks a bunch.

This topic is 5889 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.