Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Specify date format in XSL


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

Recommended Posts

  • Newbies
Posted

I use server7 advanced with custom web pages.

In my databases I use the date format "yyyy-mm-dd", but on my web pages the date is viewed as "mm/dd/yyyy". How can i specify that the date format on the web pages should be "yyyy-mm-dd"?

/Henrik

  • 3 weeks later...
  • 5 weeks later...
  • Newbies
Posted

The FileMaker Site Assistant generated a recordlist.xsl file that dug out the date in my datafile like this

td align="left">

<xsl:for-each select="fmrs:field[@name='c_Created_date']/fmrs:data">

<xsl:if test="position() != 1"><br/></xsl:if>

<xsl:value-of select="."/>

<xsl:if test=". = ''">

<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>

</xsl:if>

</xsl:for-each>

</td>

This returns date in the format "mm/dd/yyyy"

Any ideas to make that "dd-mm-yyyy"?

  • 3 months later...
Posted

This works great for displaying a date in the appropriate format but what happens when you wish to convert the date format on the form when finding a record.

The problem I have is that the form I use to search the database uses the format MM/dd/yyyy but the subsequent display pages (which use the extension function above) display the date in dd/MM/yyyy. How do I convert the date in the form to the format dd/MM/yyyy?

Posted

Cheers for that.

Anybody know why the wpe formats the date into MM/dd/yyyy? Wouldn't it be better if it just passed the data through without formatting it? That way you could manipulate it how you wanted it within the actual database itself and have that reflected on your pages without having to go to all this extra effort.

Posted

No, it's much better like it is now than in the "good old" CMDL days, where date formats seldom worked as they should (depending on the language of FMS and FMU). Think of a multilingual country (as the one where I come from). You need only one date in the DB, but depending on the language of your web pages, you can now adjust the date format as you like. Also for certain web services you need special date formats, e.g. W3CDTF for Dublin Core metadata.

What I'm missing is a function with which one could subtract dates from each other. The fmxslt:compare_date(date1,date2) function just yields 1,0,-1 depending on if date1 is after, at the same date as, or before date2. It could also yield the difference in days ...

Posted

smile.gif I'll take your word for it. I guess I'm just bit peeved as the regional date format in my country is dd/MM/yyyy and just about every piece of software I touch does things in the american format. For obvious reasons I'll admit but it gets frustrating after a while.

Anyway I continued my problem in the other thread you directed me too. So if you feel inclined I'd appreciate any further help.

Cheers.

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