Brian Dunning's FileMaker Custom Functions

InterpretDateFromText ( dateText ; noResult )

interpret a date from a date as text string

  Average rating: 4.6 (26 votes) Log in to vote

Tim Anderson   Tim Anderson
Tim Anderson Group

Share on Facebook Share on Twitter

  Sample input:
8th October 2009
9 February 2010
November 1 2007
8/1/2008
8.7.11
  Sample output:
08/10/2009
09/02/2010
01/11/2007
08/01/2008
08/07/2011

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

Will try and extract a date from text in a non standard format. Safely interprets dates in formats that FileMaker recognises

e.g. 8th October 2009, 9 February 2010, November 1 2007, 8/1/2008, 8.7.11

You have the option - ‘noResult’ - on what to return if a valid date cannot be found. Note that the month name must be either complete or only the first 3 letters, if you want/need to extend this just add more pairs of parameters in the Substitute command, but make sure that you put them in order of the length of the replaced text - see September as an example.

 

Comments

john renfrew   john renfrew, attitude
Feb 25, 2015
Tim,
typo
; ["Jan"; 1] ;
should be
; ["jan"; 1] ;
 
Tim Anderson   Tim Anderson, Tim Anderson Group
Feb 25, 2015
Thanks John, corrected!
 

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.