Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages

Shopping Cart
Shopping Cart


Free Newsletter


Privacy Policy

FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.


 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

IsDate ( _var )

Rate this function:  

  Average rating: 4.8  (24 votes)
  Discuss this Custom Function

Rewolfer, -

return valid date as number of days since 0001-01-01 or nothing if invalid

Sample Input:
IsDate ( "2003-11-23" )
IsDate ( "23.11.2003" )
IsDate ( "11/23/2003" )
IsDate ( "23/11/2003" )
Sample Output:

 Then copy & paste into FileMaker Advanced's Edit Custom Function window.



FORM: IsDate ( _var )

PURPOSE: return valid date as number of days since 0001-01-01 or nothing if invalid

PARAMETER: _var type: unknown value: unknown
valid date: "2003-1-23" / "2003-01-01" / "2003-1-1" / "23. 1.2003" / " 1/23/2003"
invalid date: "03-10-01" / "30.02.2003" / "20030123" / 735223 (FMP internal format)

RESULT: number of days since 0001-01-01 or nothing


NOTE: requires 4-digit-year (otherwise what is 10/10/10)
whitespace is tolerated
accepted formats: "Y-M-D" and "D.M.Y" and either "M/D/Y" or "D/M/Y"
you have to set $$IsDateFormatPreferred to "D/M/Y" via script if you prefer UK-dates instead of US-dates and vice versa (so 1/4/2003 => 2003-04-01)
to import foreign dates set "auto calculated value" of your date field to "GetAsDate ( IsDate ( Self ))"

EXAMPLE: IsDate ( "11/23/2003" ) => 731542

SOURCE: tsw @

Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it


Your example IsDate ( "23/11/2003" ) returns a blank output?

Lee Smith, Woodland
April 22, 2012 3:01pm

One other point:

Although both

are valid dates, how would you determine which one is correct if they are imported?

March 4th
April 3rd

Lee Smith, Woodland
April 22, 2012 3:10pm

This depends on your system settings. On US-systems this date would be viewed as the 11th day of month 23 of the year 2003 which is FALSE and thus returns nothing.
If you want this British date to be converted to your US-format you have to set the global variable $$IsDateFormatPreferred to "D/M/Y" and you get a result of "731542". No one except you knows what kind of dates you handle. By just looking at 10/1/2001 we could face January or October. Hence the possibility to overrule the system setting with the variable. If you don't overrule "23/11/2003" is correctly invalid.

The idea of this (helper-) function is to validate AND convert dates to numbers. Very helpful when importing.

Rewolfer, Berlin
April 22, 2012 3:24pm

To further clarify the output:
On all system except British ones "23/11/2003" won't output anything. Only if you overrule with $$IsDateFormatPreferred = "D/M/Y", the custom function accepts the input. Might be unfair for UK-folks, but the user base in the US is simply larger.

I use this function a lot to import VALID dates of foreign origin. A Chinese date of "2003-11-23" is auto evaluated to "23.11.2003". If you simply swap the digits I could end up with "2003-0-23" finding its way into the FileMaker-DB.

Rewolfer, Berlin
April 22, 2012 3:43pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 5 + 2 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. SortList ( theList )
  (Sat, Jun 23, 8:45am)
2. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
3. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
4. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
5. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
6. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
7. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
8. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)

RSS Feed of Custom Functions