Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Dec 26, 2011 @ 00:20
    Biagio Paruolo
    0

    Get time from Rfc822 datetime

    How get time from Rfc822 date?

    Thank you 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 26, 2011 @ 00:39
    Jan Skovgaard
    0

    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

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Dec 26, 2011 @ 11:53
    Biagio Paruolo
    0

    Hi,

    yes is a valid format, see here: http://www.eco-newsperiodico.com/ ( meteo section ).

    I need only time part.

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 26, 2011 @ 12:05
    Jan Skovgaard
    0

    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

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Dec 27, 2011 @ 23:18
    Biagio Paruolo
    0

    Hi, Jan,

    thank you. I'll try.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 29, 2011 @ 23:24
    Jan Skovgaard
    0

    Hi Biagio

    Did you succeed with this? :)

    /Jan

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Dec 30, 2011 @ 08:57
    Biagio Paruolo
    0

    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!

Please Sign in or register to post replies

Write your reply to:

Draft