Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 28th, 2012  |  syntax: None  |  size: 0.70 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. format and display datetime in xslt
  2. <A>
  3.     <StartDate>2011-11-01T00:00:00</StartDate>
  4.     <EndDate>2011-11-30T00:00:00</EndDate>
  5.     <IsRecurring>false</IsRecurring>
  6. </A>
  7.        
  8. 01/11/2011 - 30/11/2011
  9.        
  10. <xsl:value-of select="A/StartDate/> - <xsl:value-of select="A/EndDate/>
  11.        
  12. 2011-11-01T00:00:00 - 2011-11-30T00:00:00
  13.        
  14. <xsl:variable name="dt" select="'2011-11-01T12:13:59'"/>
  15.  
  16.         <xsl:value-of select="concat(
  17.                       substring($dt, 9, 2),
  18.                       '/',
  19.                       substring($dt, 6, 2),
  20.                       '/',
  21.                       substring($dt, 1, 4)
  22.                       )"/>
  23.        
  24. substring(replace($input, "(d{4})-(d{2})-(d{2})", "$3/$2/$1"), 0, 11)