Jump to content

Date format in exported csv-file


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

Recommended Posts

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 2829 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
 Share

×
×
  • Create New...

Important Information

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