Round a timestamp value to nearest minute value defined by seconds
Be the first to rate this function Log in to vote
|Jeff Morrison - Show more from this author|
where current timestamp is 1/1/2023 02:03:33
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Call this function and hand it 2 parameters: timestamp & number representing seconds to round.
Insert Calculated Result [Select ; TableName::FieldName; RountTS ( Get ( CurrentHostTimestamp) ; 300 )]
This would get the current host timestamp, round it using the 300 seconds (5 minutes) then insert that value into the chosen field.
|Michael Horak, *COMMENT Visual Realisation
Mar 17, 2023
|How about simply:
Round ( given_timestamp / precision ; 0 ) * precision
The value of the precision parameter can be given as time or as a number of seconds.
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.