title: Convert 24 hour time to 12 hour time in XSLT
body: <p>Converting the hour seems to take a lot of work... there must be a simpler way.</p>
  
  <pre><code>  &lt;xsl:variable name="hour12"&gt;
      &lt;xsl:choose&gt;
        &lt;xsl:when test="$hour24 &amp;lt; 0"&gt;
          &lt;xsl:value-of select="12 + $hour24" /&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when test="$hour24 = 0"&gt;
          &lt;xsl:value-of select="12" /&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when test="$hour24 = 12"&gt;
          &lt;xsl:value-of select="$hour24" /&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:when test="$hour24 &amp;gt; 12"&gt;
          &lt;xsl:value-of select="$hour24 - 12" /&gt;
        &lt;/xsl:when&gt;
        &lt;xsl:otherwise&gt;
          &lt;xsl:value-of select="$hour24" /&gt;
        &lt;/xsl:otherwise&gt;
      &lt;/xsl:choose&gt;
    &lt;/xsl:variable&gt;
  </code></pre>
  
  <p>Any suggestions?</p>