Brian Dunning's FileMaker Custom Functions

TimeStampsBetweenList ( startTimeStamp ; endTimeStamp ; increment )

Calculates all the timestamps between two start and end timestamps with the given incriment value.

  Average rating: 4.3 (34 votes) Log in to vote

Jonathan Mickelson   Jonathan Mickelson

Share on Facebook Share on Twitter

  Sample input:
TimeStampsBetweenList ( "10/01/2006 1:00:00"; "10/01/2006 2:00:00"; "0:20:00" )
  Sample output:
10/01/2006 1:00:00¶
10/01/2006 1:20:00¶
10/01/2006 1:40:00

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

Calculates all the timestamps between two start and end timestamps with the given incriment value. This can be useful to round out time values, calculate multi-line time based keys for relationships or generate Timestamp value lists.

Output Format:

A text value list of timestamps found between the start and end time, by incriments given by the incriments parameter. Value list results return text values by their nature, thus when utilizing this custom function it may be necessary to convert any other fields using a GetAsText ( ) or GetAsTimestamp ( ) functions.

Parameters:

startTimeStamp - The TimeStamp value to start from. This time is included within the returned value list result.

endTimeStamp - A TimeStamp value to end calculation before. This time is NOT included within the returned value list result, as only incriments less than the end time are calculated, since the startTimeStamp is inclusive.

increment - A Time value representing the interval to increment by. The granularity is flexible, so hours, minutes, seconds can all be used.
---------------------
Modified: 12-3-2012
- Typed the three inputs explicitly as timestamps and time's respectively to make sure the resulting calculations function properly.

 

Comments

Martine   Martine, Terrebonne
Nov 4, 2013
My Question,

Could we have this list to ignore Weekend and or a holiday list?
 
Jonathan M.   Jonathan M., Los Angeles, CA
Nov 4, 2013
Hi Martine,

For that I don't think you'd wants actual timestamps, try looking at another Custom Function of mine, at (http://www.briandunning.com/cf/1509), it is working days and is designed to handle specific working days as well as a holiday list (which can be put together from another Cf of mine, http://www.briandunning.com/cf/441).

Hope this helps, you can also just look at the techniques applied to these various CF's and customize them according to your needs. Which was how I came up with mine as well! :)

Good Luck!, let us know what you come up with!
Jonathan
 
Martine   Martine, Terrebonne
Nov 6, 2013
Thank's Jonathan, Before i read your response it's exactly what i've use.
This function is amazing thank you again.
Sweety Martine ;-)
 

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.