Newbies Henke Posted November 16, 2004 Newbies Posted November 16, 2004 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
Newbies Phil G Posted December 7, 2004 Newbies Posted December 7, 2004 This has also completely defeated me, did you ever find an answer?
Martin Brändle Posted December 11, 2004 Posted December 11, 2004 You can use the fmxslt:convert_datetime(String oldFormat, String newFormat, String
Newbies furkeburf Posted January 10, 2005 Newbies Posted January 10, 2005 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"?
Martin Brändle Posted January 10, 2005 Posted January 10, 2005 The line <xsl:value-of select="."/> must be changed to <xsl:value-of select="fmxslt:convert_datetime('MM/dd/yyyy','dd-MM-yyyy',.)"/> Martin
Newbies furkeburf Posted January 14, 2005 Newbies Posted January 14, 2005 Thank you Martin for excellent advice!
mlight Posted May 2, 2005 Posted May 2, 2005 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?
Martin Brändle Posted May 3, 2005 Posted May 3, 2005 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 .
mlight Posted May 3, 2005 Posted May 3, 2005 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.
Martin Brändle Posted May 3, 2005 Posted May 3, 2005 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 ...
mlight Posted May 4, 2005 Posted May 4, 2005 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now