Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

A date field in my database is formatted as 2015-03-01 in the layout mode. When exporting to a csv the date is written 01/03/2015. Why and how do I change it?

Posted

Why and how do I change it?

 

Why:

The most likely reason is that your field actually contains "01/03/2015". And that your file is set to use dd/mm/yyyy as the date format.

 

How do I change it?

That depends. If you're happy with how the file behaves in terms of entering/searching for/displaying dates, and all you want is to fix the exported file, then turn on the 'Apply current layout's data formatting to exported data' option when setting up the export.

Posted

Why:

The most likely reason is that your field actually contains "01/03/2015". And that your file is set to use dd/mm/yyyy as the date format.

 

I guess you're right about that. dd/mm/yyyy is the default system setting in Danish.

 

How do I change it?

That depends. If you're happy with how the file behaves in terms of entering/searching for/displaying dates, and all you want is to fix the exported file, then turn on the 'Apply current layout's data formatting to exported data' option when setting up the export.

 

Hmmm, I'm exporting via a script. I cantt find this option in the dialog boxes. Can I (and how do I) add it as a line in the xsl-file?

Posted

I cantt find this option in the dialog boxes.

 

It's at the bottom of the 'Specify Field Order for Export' window.

 

Can I (and how do I) add it as a line in the xsl-file?

You didn't say this was an XML export. Yes, you can do the formatting in XSLT, if you prefer. Try something like:

<xsl:variable name="date" select="fmp:COL[3]/fmp:DATA"/>
<xsl:value-of select="substring-after(substring-after($date, '/'), '/')"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring-before(substring-after($date, '/'), '/')"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring-before($date, '/')"/>

Here, the date field being exported is the 3rd field in the export order.

Posted

It's at the bottom of the 'Specify Field Order for Export' window.

 

Thank you very much, Consultant. Job's done! :hug:

This topic is 3611 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.