Jump to content
Server Maintenance This Week. ×

Format a date when not in layout mode?


This topic is 3834 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Does FileMaker have a function that can format a date the way you would like? The one in the Inspector is like what I am talking about. Or do you have to write one yourself?

I have a date in one of my calculations that leaves off leading zeros on days and months I want:

9/2/2013 to be 09/02/2013

Are there any documents by FileMaker that show functions and formatting like dd = 09 YYYY = 2013?

 

Link to comment
Share on other sites

Unless you set the format of the date on a specific field, using the inspector then the only way is to use a custom function.

 

As soon as you do things like display a date in a merge field, or withing a calculated text string then you lose control of the date format.

 

There's lots around... do a Google search... Brian Dunning's site will have at least a handful of good custom functions to do what you want.

 

http://www.briandunning.com/filemaker-custom-functions/

Link to comment
Share on other sites

Does FileMaker have a function that can format a date the way you would like? The one in the Inspector is like what I am talking about.

 

Do you mean format a date within a text calculation? There is no native general function for that.

 

 

I have a date in one of my calculations that leaves off leading zeros on days and months I want:

9/2/2013 to be 09/02/2013

 

Assuming it's a dd/mm/yyyy result you want, try =

SerialIncrement ( "00" ; Day ( date ) ) & SerialIncrement ( "/00" ; Month ( date ) ) & "/" &  Year ( date )

As soon as you do things like display a date in a merge field, or withing a calculated text string then you lose control of the date format.

 

But you can merge a date field within a text object - and then apply date formats to the text object using the Inspector.

Link to comment
Share on other sites

I think the OP originally posted the date to be Month Day and Year?

 

If so I modified your calculation

 

 

SerialIncrement ( "00" ; Month ( date ) ) & "/" & SerialIncrement ( "00" ; Day ( date ) )& "/" & Year ( date )
Link to comment
Share on other sites

This topic is 3834 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.