lamBRETTa Posted April 8, 2005 Posted April 8, 2005 I am trying to keep track of peoples time. I have built the necessary 'case' so the calculated time rounds to the nearest quarter hour, but if you try and go from pm to am the calculation gets wacky. I have experimented with the MOD function as well as converting to numbers and then back to time. Anybody have any ideas? Thanks.
Ender Posted April 8, 2005 Posted April 8, 2005 What kind of wackyness are you getting? What's your calc?
lamBRETTa Posted April 8, 2005 Author Posted April 8, 2005 Let's say you are calculating 1pm to 3pm. take the start time and subtract it from the end time. You get 2 hours. Now, let's go from 9pm to 1am. If you subtract the start time from the end time you get 20 hours. Then what?
zortx3 Posted April 8, 2005 Posted April 8, 2005 Not sure if this will mess up your calculation, but maybe try calculating in military time, then formatting the result to what you need it to display.
lamBRETTa Posted April 8, 2005 Author Posted April 8, 2005 Filemaker already uses a 24 hour format for calculating, that's why you use the MOD function to bring the hour back to a 12 hour format. If you format the field using the format selection in the menu when in layout mode you are only formatting it for viewing purposes. Any other ideas? This is very frustrating.
sbg2 Posted April 8, 2005 Posted April 8, 2005 Since 1am = 1:00:00 and 9pm = 21:00:00 ... 1am - 9pm = -20 try - If(TimeEnd - TimeStart > 0; TimeEnd - TimeStart; Time(24;0;0) + (TimeEnd - TimeStart))
lamBRETTa Posted April 8, 2005 Author Posted April 8, 2005 of course...i was using the minute and hour functions, but neglected the time function. i knew it had something to do with adding time. thanks...i think i've got it now.
BobWeaver Posted April 9, 2005 Posted April 9, 2005 You were on the right track with the Mod() function. Knowing that the number of seconds in a day is 86400, you can use this method to calculate duration: Mod(86400+TimeEnd-TimeStart;86400)
Recommended Posts
This topic is 7505 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 accountSign in
Already have an account? Sign in here.
Sign In Now