<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>That's the correct behaviour for an RSS feed. I'm guessing the
      logic of this is that your website has an RSS importer already
      that makes it the desired route.</p>
    <p>Both "date" and "datestamp" should be stored in the same format
      in EPrints, so you should just have this:</p>
    <p class="MsoNormal" style="margin-left:36.0pt;text-indent:36.0pt"><span
        style="mso-fareast-language:EN-US">my $datestamp =
        $eprint-&gt;get_value( "date" );</span></p>
    <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
        if( $datestamp =~ /^(\d{4})-(\d{2})-(\d{2})
        (\d{2}):(\d{2}):(\d{2})$/ )</span></p>
    <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
        {</span></p>
    <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                               
        my $time = timelocal( $6, $5, $4, $3, $2-1, $1 );</span></p>
    <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                               
        $item-&gt;appendChild( $session-&gt;render_data_element(</span></p>
    <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                                               
        2,</span></p>
    <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                                               
        "pubDate",</span></p>
    <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                                               
        EPrints::Time::rfc822_datetime( $time ) ) );</span></p>
    <span style="mso-fareast-language:EN-US">                               
      }<br>
      <br>
      So now it's an RSS feed with the dates of the items in the
      catalogue, rather than of catalogue records.<br>
      <br>
    </span>
    <div class="moz-cite-prefix">On 21/11/2017 16:05, Andrew Beeken
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:EMEW3|25f8875a772788c360367c090d0505d9yAKG7x14eprints-tech-bounces|ecs.soton.ac.uk|AM0PR0602MB34260F519AC24C94C0C079618E230@AM0PR0602MB3426.eurprd06.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle24
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Okay,
            so the goalposts have shifted on this since talking in more
            detail with our ICT team!<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">Basically,
            our repository feeds our staff directory pages in real time
            using the available feeds; specifically this feed:
            <a
href="http://eprints.lincoln.ac.uk/cgi/exportview/creators/userid/RSS2/userid.xml"
              moz-do-not-send="true">
http://eprints.lincoln.ac.uk/cgi/exportview/creators/userid/RSS2/userid.xml</a>.
            I did question why the RSS2 feed was being used and received
            the answer that this particular feed formats up a
            “Description” which can be pulled straight into the staff
            profiles which are then ordered based on the date on the
            record. So far, so good, but the issue at hand is those
            dates. I initially thought the problem was the format that
            the dates were coming out in and proposed that we include
            the records pre-formatted citation in the standard XML feed
            for them.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">However,
            it now transpires that the date on the RSS2 feed is just
            plain wrong; it’s using the datestamp, when the record was
            created, rather than the date that the article, book etc was
            published, as stored in the date field. For the academics
            this means that the records on their staff profile are not
            in publication order. So we come back to the decision – use
            the standard XML file and add the citation, or change the
            RSS2 template to use the published date rather than the
            created date. ICT would prefer the latter so that they don’t
            have to change the staff directory code.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">I’ve
            been taking a look at the latter an I think I’ve found the
            chunk in the RSS2 script that deals with the date:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"
          style="margin-left:36.0pt;text-indent:36.0pt"><span
            style="mso-fareast-language:EN-US">my $datestamp =
            $eprint-&gt;get_value( "datestamp" );<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
            if( $datestamp =~ /^(\d{4})-(\d{2})-(\d{2})
            (\d{2}):(\d{2}):(\d{2})$/ )<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
            {<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                               
            my $time = timelocal( $6, $5, $4, $3, $2-1, $1 );<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                               
            $item-&gt;appendChild( $session-&gt;render_data_element(<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                                               
            2,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                                               
            "pubDate",<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                                                               
            EPrints::Time::rfc822_datetime( $time ) ) );<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
            }<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">I
            tried tweaking this to change datestamp to date, however
            this completely removed the date from the feed. I’m guessing
            that this is something to do with how the RegEx decides to
            proceed on the if statement. So I thought I’d see what
            happened if I just pushed the date straight into the element
            which… didn’t work…<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
            $item-&gt;appendChild( $session-&gt;render_data_element(<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
                            2,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
                            "pubDate",<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">                               
                            EPrints::Time::rfc822_datetime(
            $eprint-&gt;get_value( "date" ) ) ) );<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US">I’m
            sure there’s obvious reasons for that which I probably can’t
            see (I always feel code dyslexic when I look at EPrints
            source for some reason…) Personally I’d prefer to push the
            citation in a more capable feed than RSS2 but I think I’m
            going to be at the behest of the Staff Directory here.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span
                lang="EN-US"> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>
                [<a class="moz-txt-link-freetext" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>]
                <b>On Behalf Of </b>John Salter<br>
                <b>Sent:</b> 21 November 2017 14:53<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><br>
                <b>Subject:</b> Re: [EP-tech] Adding items to EP-XML
                template<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span
            style="color:#1F497D;mso-fareast-language:EN-US">&gt;</span>
          <span lang="EN-US">The XML export just exports all the fields
            on an object<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Unless that field has<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">    export_as_xml =&gt;
            0,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">- like the suggestions
            field does by default…<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">What are you trying to
            achieve with your export?<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Personally, I'd suggest
            subclassing that plugin, and adding a citation to it that
            way - as always, TMTOWTDI!<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">It depends on how and
            when you'll be calling the plugin.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">If it's for active,
            user-generated requests, Adam's method may be more suitable,
            as the processing is done when a record is saved, rather
            than when a record is requested.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Cheers,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">John<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span
                lang="EN-US"> <a
                  href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"
                  moz-do-not-send="true">
                  eprints-tech-bounces@ecs.soton.ac.uk</a> [<a
                  href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"
                  moz-do-not-send="true">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>]
                <b>On Behalf Of </b>Adam Field<br>
                <b>Sent:</b> 21 November 2017 14:34<br>
                <b>To:</b> <a
                  href="mailto:eprints-tech@ecs.soton.ac.uk"
                  moz-do-not-send="true">eprints-tech@ecs.soton.ac.uk</a><br>
                <b>Subject:</b> Re: [EP-tech] Adding items to EP-XML
                template<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><span lang="EN-US">Hi Andrew<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                The XML
            export just exports all the fields on an object.  I wouldn’t
            modify it if I were you.  The simplest way would be to add a
            new field to your item.<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                I’m not
            sure if virtual fields come out in the XML export, but if
            they do, adding a virtual field to your object may be the
            easiest way to do this.  Alternatively, use an automatic
            field and write the citation to it.  See <o:p></o:p></span></p>
        <p class="MsoNormal" style="text-align:justify"><span
            lang="EN-US"><a
              href="https://wiki.eprints.org/w/Training_Video:Virtual_Fields"
              moz-do-not-send="true">https://wiki.eprints.org/w/Training_Video:Virtual_Fields</a>
            and
            <a
              href="https://wiki.eprints.org/w/Training_Video:Automatic_Fields"
              moz-do-not-send="true">https://wiki.eprints.org/w/Training_Video:Automatic_Fields</a>
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">--<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Adam<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <div style="border:none;border-top:solid #B5C4DF
          1.0pt;padding:3.0pt 0cm 0cm 0cm">
          <p class="MsoNormal" style="margin-left:36.0pt"><b><span
                style="color:black" lang="EN-US">From:
              </span></b><span style="color:black" lang="EN-US">&lt;<a
                href="mailto:eprints-tech-bounces@ecs.soton.ac.uk"
                moz-do-not-send="true">eprints-tech-bounces@ecs.soton.ac.uk</a>&gt;
              on behalf of Andrew Beeken &lt;<a
                href="mailto:anbeeken@lincoln.ac.uk"
                moz-do-not-send="true">anbeeken@lincoln.ac.uk</a>&gt;<br>
              <b>Reply-To: </b>&lt;<a
                href="mailto:eprints-tech@ecs.soton.ac.uk"
                moz-do-not-send="true">eprints-tech@ecs.soton.ac.uk</a>&gt;<br>
              <b>Date: </b>Tuesday, 21 November 2017 14:24<br>
              <b>To: </b>"<a href="mailto:eprints-tech@ecs.soton.ac.uk"
                moz-do-not-send="true">eprints-tech@ecs.soton.ac.uk</a>"
              &lt;<a href="mailto:eprints-tech@ecs.soton.ac.uk"
                moz-do-not-send="true">eprints-tech@ecs.soton.ac.uk</a>&gt;<br>
              <b>Subject: </b>[EP-tech] Adding items to EP-XML template</span><span
              style="font-size:12.0pt;color:black" lang="EN-US"><o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal" style="margin-left:36.0pt"><span
              style="font-family:&quot;Times New Roman&quot;,serif"
              lang="EN-US"><o:p> </o:p></span></p>
        </div>
        <p class="MsoNormal" style="margin-left:36.0pt"><span
            lang="EN-US">Hi all,<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:36.0pt"><span
            lang="EN-US"> <o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:36.0pt"><span
            lang="EN-US">Just took a dive into the EPrints XML export
            template (perl_lib/EPrints/Plugin/Export/XML.pm) to try and
            add a node for the records citation to it and I can’t see
            where you would do this? Is there somewhere separate that
            defines what data it pulls through?<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:36.0pt"><span
            lang="EN-US"> <o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:36.0pt"><span
            lang="EN-US">Cheers in advance!<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:36.0pt"><span
            lang="EN-US">Andrew<o:p></o:p></span></p>
        <div>
          <p class="MsoNormal" style="margin-left:36.0pt"><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,serif" lang="EN-US"><br>
              <a href="http://www.lincoln.ac.uk/opendays"
                moz-do-not-send="true"><span style="border:solid
                  windowtext 1.0pt;padding:0cm;text-decoration:none"><img
                    style="width:7.8541in;height:1.3541in"
                    id="_x0000_i1025"
                    src="cid:part12.70918ABF.42453E0B@ecs.soton.ac.uk"
                    alt="Image removed by sender. EF Gold" class=""
                    width="754" border="0" height="130"></span></a><br>
            </span><span style="font-size:10.0pt;font-family:&quot;Times
              New Roman&quot;,serif" lang="EN-US"><br>
              <b>The University of Lincoln, located in the heart of the
                city of Lincoln, has established an international
                reputation based on high student satisfaction, excellent
                graduate employment and world-class research.</b></span><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,serif" lang="EN-US"><o:p></o:p></span></p>
        </div>
        <div>
          <p class="MsoNormal" style="margin-left:36.0pt"><span
              style="font-size:7.5pt;font-family:&quot;Arial&quot;,sans-serif"
              lang="EN-US"><br>
              The information in this e-mail and any attachments may be
              confidential. If you have received this email in error
              please notify the sender immediately and remove it from
              your system. Do not disclose the contents to another
              person or take copies.<br>
              <br>
              Email is not secure and may contain viruses. The
              University of Lincoln makes every effort to ensure email
              is sent without viruses, but cannot guarantee this and
              recommends recipients take appropriate precautions.<br>
              <br>
              The University may monitor email traffic data and content
              in accordance with its policies and English law. Further
              information can be found at:
              <a href="http://www.lincoln.ac.uk/legal"
                moz-do-not-send="true">http://www.lincoln.ac.uk/legal</a>.</span><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,serif" lang="EN-US">
              <o:p></o:p></span></p>
        </div>
        <p class="MsoNormal" style="margin-left:36.0pt"><span
            style="font-size:12.0pt;font-family:&quot;Times New
            Roman&quot;,serif" lang="EN-US">*** Options:
            <a
              href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech"
              moz-do-not-send="true">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
            *** Archive:
            <a href="http://www.eprints.org/tech.php/"
              moz-do-not-send="true">http://www.eprints.org/tech.php/</a>
            *** EPrints community wiki:
            <a href="http://wiki.eprints.org/" moz-do-not-send="true">http://wiki.eprints.org/</a>
            *** EPrints developers Forum:
            <a href="http://forum.eprints.org/" moz-do-not-send="true">http://forum.eprints.org/</a>
            <o:p></o:p></span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
*** EPrints developers Forum: <a class="moz-txt-link-freetext" href="http://forum.eprints.org/">http://forum.eprints.org/</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Christopher Gutteridge -- <a class="moz-txt-link-freetext" href="http://users.ecs.soton.ac.uk/cjg">http://users.ecs.soton.ac.uk/cjg</a>

University of Southampton Open Data Service: <a class="moz-txt-link-freetext" href="http://data.southampton.ac.uk/">http://data.southampton.ac.uk/</a>
You should read our Web &amp; Data Innovation blog: <a class="moz-txt-link-freetext" href="http://blogs.ecs.soton.ac.uk/webteam/">http://blogs.ecs.soton.ac.uk/webteam/</a>

</pre>
  </body>
</html>