Brian Dunning's FileMaker Custom Functions

Quarter24Hrs ( Timestamp )

Returns Timestamp, rounds time to quarter hour without seconds

  Average rating: 3.9 (20 votes) Log in to vote

Omelyan Burtnyk   Omelyan Burtnyk

Share on Facebook Share on Twitter

  Sample input:
Quarter24Hrs ( 1/13/2017 11:37:58 AM )
  Sample output:
13JAN17 11:45

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

The number of hours worked by non-exempt employees are calculated using the quarter-hour rounding method. This means that an employee’s arrival and departure times are rounded to the closest quarter of the hour when calculating the timesheet. Using 8:00 AM as an example, employees will be paid from 8:00, 8:15, 8:30, 8:45 or 9:00.

 

Comments

comment   comment, VR
Jul 2, 2016
I don't think this works.

Anyway, to round a timestamp to the nearest quarter hour, you only need to do:

Round ( timestamp / 900 ; 0 ) * 900
 
Omelyan Burtnyk   Omelyan Burtnyk
Jul 2, 2016
Thanks for your comment Mr. VM
I think you meant:
GetAsTime ( Round ( Get ( CurrentTime ) / 900 ; 0 ) * 900 )

because Timestamp function has 2 parameters date and time
Timestamp ( date ; time )
 
Omelyan Burtnyk   Omelyan Burtnyk
Jul 2, 2016
and my example working properly
 
Omelyan Burtnyk   Omelyan Burtnyk
Jan 13, 2017
Made changes to prevent doublings
 

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.