title: Convert epoch to Date via XSL from XML attribute and display in HTML
body: <p>First time posting and am very new to working with XML and XSL.</p>
  
  <p>I've spent two days on this board and others looking for my answer.  I see posts similar to mine, but not exact.  My apologies if this is redundant.</p>
  
  <p>I have an XML document output to me from a 3rd party application on a daily basis.  I need to display on a webpage two pieces of information from it:  <strong>LoginName</strong> and <strong>LastBackupDate</strong>.  </p>
  
  <p>I am able to do this via an XSL that I wrote.  However, the LastBackupDate is in epoch format.  I need to convert it to human readable Date/Time (mm-dd-yyyy hh:mm:ss).</p>
  
  <p>Is it possible to convert this "on the fly" via an XSL stylesheet?</p>
  
  <p>If so, can somebody assist?  I've tried so many variations of what I've found here and on several other websites that I'm now at a loss...</p>
  
  <p>What is definitely making this more difficult for me is the format of the XML file - it is mostly attributes.  Most every example I find uses elements.</p>
  
  <p>Here is my XML (company1.xml):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="company1.xsl" ?&gt;
  
    &lt;Users&gt;
      &lt;User LoginName="server1" Owner="company1" UserId="server1#24545" Alias="server1" UserType="PAID" ClientType="ERM" Quota="536870912000" Timezone="GMT+01:00 (CEST)" Language="en" DataFile="191277" DataSize="120105299488" RetainFile="1195" RetainSize="49220308" EnableMSSQL="Y" EnableMSExchange="N" MsExchangeQuota="0" EnableOracle="N" EnableLotusNotes="N" EnableLotusDomino="N" EnableMySQL="N" EnableInFileDelta="Y" EnableShadowCopy="Y" EnableExchangeMailbox="N" ExchangeMailboxQuota="0" EnableNASClient="N" EnableDeltaMerge="N" EnableMsVm="N" MsVmQuota="0" EnableVMware="N" VMwareQuota="0" Bandwidth="0" Notes="" Status="ENABLE" RegistrationDate="1222175386552" SuspendPaidUser="N" SuspendPaidUserDate="20110221" LastBackupDate="1421247632689" EnableCDP="Y" EnableShadowProtectBareMetal="Y" EnableWinServer2008BareMetal="Y" Hostname="backup.company1.com"&gt;
        &lt;Contact Name="Spain Reception" Email="spain.reception@company1.com" /&gt;
      &lt;/User&gt;
      &lt;User LoginName="server2" Owner="company1" UserId="server2#24545" Alias="server2" UserType="PAID" ClientType="ERM" Quota="536870912000" Timezone="GMT-06:00 (CDT)" Language="en" DataFile="123920" DataSize="69665584875" RetainFile="0" RetainSize="0" EnableMSSQL="Y" EnableMSExchange="N" MsExchangeQuota="0" EnableOracle="N" EnableLotusNotes="N" EnableLotusDomino="N" EnableMySQL="N" EnableInFileDelta="Y" EnableShadowCopy="Y" EnableExchangeMailbox="N" ExchangeMailboxQuota="0" EnableNASClient="N" EnableDeltaMerge="N" EnableMsVm="N" MsVmQuota="0" EnableVMware="N" VMwareQuota="0" Bandwidth="0" Notes="" Status="ENABLE" RegistrationDate="1212767489088" SuspendPaidUser="N" SuspendPaidUserDate="20141223" LastBackupDate="1361926839272" EnableCDP="Y" EnableShadowProtectBareMetal="Y" EnableWinServer2008BareMetal="Y" Hostname="backup.company1.com"&gt;
        &lt;Contact Name="server2" Email="IT.systemadministrators@company.com" /&gt;
      &lt;/User&gt;
    &lt;/Users&gt;
  </code></pre>
  
  <p>Here is my XSL (company1.xsl):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
    &lt;xsl:template match="/"&gt;
      &lt;html&gt;
  
      &lt;body&gt;
        &lt;h3&gt;COMPANY1 Last Backup Date&lt;/h3&gt;
        &lt;table border="1"&gt;
          &lt;tr bgcolor="#9acd32"&gt;
            &lt;th&gt;LoginName&lt;/th&gt;
            &lt;th&gt;Epoch LastBackupDate&lt;/th&gt;
            &lt;th&gt;Human dateTime&lt;/th&gt;
          &lt;/tr&gt;
  
          &lt;xsl:for-each select="//User"&gt;
            &lt;tr&gt;
              &lt;td&gt;
                &lt;xsl:value-of select="@LoginName" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                &lt;xsl:value-of select="@LastBackupDate" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                &lt;xsl:value-of select='xs:dateTime("1970-01-01T00:00:00") @LastBackupDate * xs:dayTimeDuration("PT0.001S")'/&gt;
              &lt;/td&gt;
            &lt;/tr&gt;
          &lt;/xsl:for-each&gt;
  
        &lt;/table&gt;
      &lt;/body&gt;
  
      &lt;/html&gt;
    &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>