<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="extensions" page="functions" subpage="last-modified"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: saxon:last-modified()</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title"
            content="Saxonica: XSLT and XQuery Processing: saxon:last-modified()"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>saxon:last-modified()</h1>
      <p><b>saxon:last-modified(uri as xs:string()?) ==&gt; xs:dateTime?</b></p>
      <div class="boxed"
           style="border: solid thin; background-color: #B1CCC7; padding: 2px">The specification of this function has changed in Saxon 9.2. To find the last-modified date of the file from which
    a given node was loaded, use <code>saxon:last-modified(document-uri($node))</code>
         </div>
      <p>This function returns the date and time when a file was modified.</p>
      <p>If the argument is an empty sequence, the result is an empty sequence.</p>
      <p>Otherwise the argument must be a valid URI. If it is a relative URI, this will be resolved against the base URI from
      the static context. The function has been tested with URIs using the <code>file</code> and <code>http</code>
      schemes, and is not guaranteed to give a result with other URI schemes (or indeed with these, under all circumstances).</p>
      <p>The function returns an <code>xs:dateTime</code> value which will usually be in a specific timezone. The result can therefore
      be formatted using the <code>format-dateTime</code> function, or input to arithmetic and comparisons against other dates and times.</p>
      <p>If the URI is not syntactically valid, error FODC0005 is thrown. If the resource identified by the URI cannot be
      retrieved, error FODC0002 is thrown. If the resource is successfully retrieved but no date/time information is available,
      the function returns an empty sequence.</p>
      <p>Example:</p>
      <div class="codeblock"
           style="border: solid thin; background-color: #B1CCC7; padding: 2px">
         <pre>
            <code>format-dateTime(file-last-modified(resolve-uri('lookup.xml', static-base-uri()))</code>
         </pre>
      </div>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="leading.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>