xsl datetime format with correct Timezone

I am working with rss newsfeed and my xml data is something like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type='text/xsl' href='rssfeed.xsl'?>
<rss version="2.0">
    <copyright>Copyright MHA</copyright>
    <generator>Webservice og DB</generator>
    <lastBuildDate>Tue, 03 May 2005 15:22:43 GMT</lastBuildDate>
      <pubDate>Sun, 24 Apr 2005 22:00:00 GMT</pubDate>
My rssfeed.xsl:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <h2>My rss</h2>
    <table style="TABLE-LAYOUT: fixed" cellSpacing="0" cellPadding="0" width="100%" border="0" heihjt="100%">
      <tr bgcolor="#9acd32">
        <th align="left">News</th>        
      <xsl:for-each select="rss/channel/item">
      <xsl:variable name="articleid"><xsl:value-of select="link"/></xsl:variable>
      <a href="{$articleid}"><xsl:value-of select="title"/></a>
My question is how can I transform date and time format like this DD.MM.YYYY HH:mm:ss with a Norwegian Timezone(GMT+1) from the xml pubDate node.

Many thanks in advance!
Who is Participating?
ramazanyichConnect With a Mentor Commented:
in standard XSLT 1.0 you can't work with date formats.
But many popular XSLT processors support exslt.com extensions and that extensions have some functions which support manipualtion with dates. check http://exslt.org/date/index.html 
Which XSLT processor do you use?
michaenhAuthor Commented:
I use standard XSLT 1.0.
So it is not possible? .. hm.. well I will check out with http://exslt.org/date/index.html.

Added this to the .xsl file:
<xsl:variable name="day" select="substring-before(substring-after($date, ' '), ' ')"/>
<xsl:variable name="monthName" select="substring-before(substring-after(substring-after($date, ' '), ' '), ' ')"/>
<xsl:variable name="month" select="substring(substring-after('Jan01Feb02Mar03Apr04May05Jun06Jul07Aug08Sep09Oct10Nov11Dec12', $monthName), 1, 2)"/>
<xsl:variable name="year" select="substring-before(substring-after(substring-after(substring-after($date, ' '), ' '), ' '), ' ')"/>
<xsl:variable name="Time" select="substring-before(substring-after(substring-after(substring-after(substring-after($date,' '),' '),' '),' '),' ')"/>
<xsl:value-of select="concat($day,'.',$month, '.',$year,' ',$Time)"/>

 I will get:
24.04.2005 22:00:00, but it s not the correct Timezone.

I'll be back.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.