Ok, if you only need the time part the concept is the same but you should change the start and end points so the substring starts at 18 and ends at 29 (26 if you want to omit the EST part for instance).
Like this <xsl:value-of select="'Wed, 02 Oct 2002 08:00:00 EST','18','29'" />
Get time from Rfc822 datetime
How get time from Rfc822 date?
Thank you
Hi Biagio
Is the generated format valid? Is our source a RSS feed, or?
If it's like <pubDate>Wed, 02 Oct 2002 08:00:00 EST</pubDate>
Then it should be fairly simple to get "02 Oct 2002" by using the substring function of XSLT like this
<xsl:value-of select="substring('Wed, 02 Oct 2002 08:00:00 EST','6','17')" />
This should return only the date part.
Hope this helps.
/Jan
Hi,
yes is a valid format, see here: http://www.eco-newsperiodico.com/ ( meteo section ).
I need only time part.
Thanks
Hi Biagio
Ok, if you only need the time part the concept is the same but you should change the start and end points so the substring starts at 18 and ends at 29 (26 if you want to omit the EST part for instance).
Like this <xsl:value-of select="'Wed, 02 Oct 2002 08:00:00 EST','18','29'" />
Hope this helps.
/Jan
Hi, Jan,
thank you. I'll try.
Hi Biagio
Did you succeed with this? :)
/Jan
Hi Jan,
yes and no...I' ve made this:
<xsl:variable name="parteGiorno" select="substring($DataPub,'23','2')"/> --> I get "am" or "pm"
<xsl:variable name="oraAlbaSplitted" select="umbraco.library:Split($AstroSunRise, ':')"/>
<xsl:variable name="oraAlba" select="$oraAlbaSplitted//value" />
So, in the oraAlba, I've the hour value and hour+"am" or "pm", I've know if I'm in the morning or in the afternoon...
Have you a simpler solution?
Bye and Happy New Year!
is working on a reply...