Brian Dunning's FileMaker Custom Functions

YMDFormat ( theDate )

Reformats a given date into text as YYYY-MM-DD

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

David Goetzka   David Goetzka
shinynew
http://shinynew.com

Share on Facebook Share on Twitter

  Sample input:
YMDFormat( 1/1/1986 )
  Sample output:
1986-01-01

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

This is my first shot at a custom function, so don't laugh. ;-) I basically needed to reformat a date in the format of YYYY-MM-DD to send as a text string.

 

Comments

Peter Bouma   Peter Bouma, Amsterdam, Netherlands
Jan 27, 2010
Instead of Case statements I'd prefer:

Year(theDate) & "-" &
Right("00" & Month(theDate); 2) & "-" &
Right("00" & Day(theDate); 2)
 
John Pollard   John Pollard, sac, ca
Jun 9, 2016
Nice clarification there. Started with a good idea made better.
Thx
 

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:

Under construction. Email me your wish list for improvements.