Brian Dunning's FileMaker Custom Functions

GetTextAsDate ( dateTxt ; formatTxt )

Convert a date string of various formats into a FMP date value

  Average rating: 4.5 (38 votes) Log in to vote

Simon Brown   Simon Brown
beezwax datatools, inc.
http://beezwax.net/

Share on Facebook Share on Twitter

  Sample input:
GetTextAsDate ("20080616"; "yyyymmdd")
  Sample output:
6/16/2008

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

Although FileMaker's built-in GetAsDate function is somewhat forgiving with its input, this function was designed to handle those that aren't covered, with 8 date formats supported, or over 40 specific variations in all. It is not fully internationalized however, since some calculations assume dates are in the mm/dd/yyyy format.

IMPORTANT: requires a separate helper function, GetMonthAsNumber (http://www.briandunning.com/cf/981) to convert a month name to its ordinal.

 

Comments

caitlin   caitlin
Jul 18, 2019
The format yyyy/mm/dd isn't included in this function, but is easily added to the section that includes "yy/mm/dd" format with no other alteration needed.
 

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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: