November 16, 200421 yr Newbies 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
December 11, 200421 yr You can use the fmxslt:convert_datetime(String oldFormat, String newFormat, String
January 10, 200520 yr Newbies 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"> </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"?
January 10, 200520 yr The line <xsl:value-of select="."/> must be changed to <xsl:value-of select="fmxslt:convert_datetime('MM/dd/yyyy','dd-MM-yyyy',.)"/> Martin
May 2, 200520 yr 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?
May 3, 200520 yr This is done normally client-side, e.g. with JavaScript. I don't have a handy example, but you might search on Google with the search terms javascript date validation or javascript date form . See also this thread .
May 3, 200520 yr 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.
May 3, 200520 yr 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 ...
May 4, 200520 yr 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.
Create an account or sign in to comment