This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Date conversion


  Yes, there are several ways.
  
  The "simplest" is to do the following, filling in the choose with the 
  rest of the months:
  
  <xsl:variable name="the-month" select="substring(text(), 4, 3)" />
  <xsl:choose>
     <xsl:when test="$the-month = 'Jan'">
          <xsl:text>01</xsl:text>
     </xsl:when>
          .
          .
          .
  </xsl:choose>
  <xsl:text>/</xsl:text>
  <xsl:value-of select="substring(text(), 1, 2)" />
  <xsl:text>/</xsl:text>
  <xsl:value-of select="substring(text(), 8, 4)" />
  
  This does assume that your input will be 01-Dec-2000 07:23:31 for 
  single digit days.


______________________________ Reply Separator _________________________________
Subject: [xsl] Date conversion
Author:  xsl-list@lists.mulberrytech.com at Internet-America
Date:    01-08-2001 9:45 AM


The format of the date returned in my XML is 17-Dec-2000 07:23:31 
I need to display the date as 12/17/2000.
  
How do I do this using xsl?
  
Thanks,
Katie
  
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
  
  
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
  

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]