June 6, 200619 yr On my xsl web page I have a portal with a time field, but the time is formatted in 24 hour format. How do I get it to display in 12 hour format? I know there are time formatting functions, but it's not clear how to apply them (this XML/XSL stuff is new to me.) This is the code: [b][/b] The 'eventdates::Time_Start' field is the one that needs formatting.
June 6, 200619 yr You can use the fmxslt:convert_datetime(String oldFormat, String newFormat, String date) function for that. If you want to count the hours 1-12 instead 0-11, use 'h:mm:ss a' instead of 'K:mm:ss a' . BTW, in your code, you were comparing two literal values, 'eventdates::Time_Start' != '0:00:00', which of course is always true. Just don't put the field name in apostrophes. I had used a variable instead, because the field is used twice (in the xsl:when and in the xsl:value-of)
Create an account or sign in to comment