Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date not formatted using "current layout formatting"

Featured Replies

  • Newbies

I am having a perplexing problem exporting a date formatted according to the layout's formatting. My export script and it's formatting has worked perfectly for over 3 years.

I have been exporting from this layout with the formatting working perfectly - the problem is that I added another date field to be exported, formatted 2007-03-06 (for a MySQL database) - the formatting refuses to stick - the output file (tab separated) always shows this new field's data as 03/06/2007. There are other date fields on the layout that export properly - I have triple checked the fields definition parameters and the formatting - it is exactly the same as the other 3 date fields on the layout. I also tried using another date field with the same results. If I export the field manually (without the script) it works fine. This script is very large so I don't want to re-write it.

Has anyone experienced this problem? Is it possibly related to an upgrade from 8 to 8.5?

Thanks in advance.

Yes, I am trying to format dates (or number, or text versions) in CCYYMMDD and am very very perplexed as well. My problem seems to stem from having started out from a date field all my months and days less than 10 show as single digit instead of two digit ( eg. 3 instead of 03).

I think after text conversion I will have write a logical calculation adding a preceding zero to single digit months and days.

Oops! I find half my answer here -

http://www.filemaker.com/help/24-Editing%20objects15.html

Now I just have to make calculation fields changing the correctly formatted (with leading zeros) date fields to number or text fields.

Check here for your answer. I just didn't see those options in the date format. I kept looking for them in the Define Database Field area.

Something like this?

this is for a date within a text field to format as 00/00/00.

If there is a simpler way, someone do share.

Case(

Day(Date_Created)<10;

"0"&Day(Date_Created);

Day(Date_Created))

&"/"&

Case(

Month(Date_Created)<10;

"0"&Month(Date_Created);

Month (Date_Created))

&"/"&

Right(Year(Date_Created) ; 2 )

You could do it this way:

Right ( "0" & Day ( YourDate ) ; 2 ) & "/" &

Right ( "0" & Month ( YourDate ) ; 2 ) & "/" &

Right ( Year ( YourDate ) ; 2 )

But I don't see why this would be required. It should be sufficient to custom-format the date on the layout, and check the "Apply current layout's data formatting..." option during export.

I just tested a streight export of dates, using various formatting of todays date, and using the option to format the fields using the current layout formatting, they exported just fine.

Here is a sniplet of it.

"2007-3-14","3/14/07","2007-3-14","2007-14-3"

HTH

Lee

p.s.

I noticed that if you have the same date on the layout, formatted differently, it will only export one of them, and it was the last one placed that was exported in my test.

Edited by Guest
p.s.

Thanks so much everyone!

Both Notaclone's and comment's calcs worked fine. I modified them to get to my required format by changing them like this:

Notaclone's calc -

Right(Year( CreationDate ) ; 4 )

&

Case(

Month( CreationDate )<10 ;

"0"&Month( CreationDate );

Month ( CreationDate ))

&

Case(

Day( CreationDate )<10;

"0"&Day( CreationDate ) ;

Day( CreationDate ))

and comment's calc -

Right ( Year ( CreationDate ) ; 4 ) &

Right ( "0" & Month ( CreationDate ) ; 2 ) &

Right ( "0" & Day ( CreationDate ) ; 2 )

The reason I specify the number of Right characters in Year is because elsewhere I need to use this same format but with a two character year ("070313") as well.

Lee's test explains why one may need to create a "pre-formated" field for an export.

Another related reason would be when embedding a merge field into a block of text.

Now I see I have to apply similar calculations for time elements but now it's a piece of cake; just a few more fields created to use for formatting.

Thanks again to Notaclone, comment and Lee!

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.