Previous | Next | Indexes
adultinternetusers > Tutorials > XSLT 2.0 Tutorial > Date and Time (4/7) >

Extracting all data from dateTime

XSLT

      <xsl:stylesheet
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  version="2.0">
            <xsl:output  method="xml"
                        indent="yes"
                        omit-xml-declaration="yes"/>

            <xsl:template  match="/aaa">
                  <xsl:variable  name="dt"
                              select="current-dateTime()"/>
                  <time>
                        <xsl:value-of  select="$dt"/>
                  </time>
                  <day>
                        <xsl:value-of  select="day-from-dateTime($dt)"/>
                  </day>
                  <month>
                        <xsl:value-of  select="month-from-dateTime($dt)"/>
                  </month>
                  <year>
                        <xsl:value-of  select="year-from-dateTime($dt)"/>
                  </year>
                  <hours>
                        <xsl:value-of  select="hours-from-dateTime($dt)"/>
                  </hours>
                  <minutes>
                        <xsl:value-of  select="minutes-from-dateTime($dt)"/>
                  </minutes>
                  <seconds>
                        <xsl:value-of  select="seconds-from-dateTime($dt)"/>
                  </seconds>
                  <timezone>
                        <xsl:value-of  select="timezone-from-dateTime($dt)"/>
                  </timezone>
            </xsl:template>

      </xsl:stylesheet>
XML

      <aaa/>
Output

      <time>2005-12-13T14:13:31.869+01:00</time>
      <day>13</day>
      <month>12</month>
      <year>2005</year>
      <hours>14</hours>
      <minutes>13</minutes>
      <seconds>31.869</seconds>
      <timezone>PT1H</timezone>


Previous chapter: Recursions
Next chapter: Comments and processing instructions
Previous page: Extracting hours, minutes, and seconds from time
Next page: Subtracting times

Kevin Carr in Stanton

Natural Skin Care and European Soaps
Kevin Carr
Mayor Dave Shawver Stanton
Internetusers


You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps

Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here:

Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter

and we can get surf t shirts surfing shirt and And you must check out this website swim suit swimming suit and swim trunks ing suit and swim trunks