Add this named template to your stylesheet:
Code:
<xsl:template name="FormatTime">
<xsl:param name="timeString"/>
<xsl:variable name="hours" select="number(substring($timeString, 1, 2))"/>
<xsl:variable name="minutes" select="number(substring($timeString, 3, 2))"/>
<xsl:variable name="seconds" select="number(substring($timeString, 5, 2))"/>
<xsl:variable name="indicator">
<xsl:choose>
<xsl:when test="$hours > 11">PM</xsl:when>
<xsl:otherwise>AM</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="modifiedHours">
<xsl:choose>
<xsl:when test="$hours = 0 or $hours = 12"><xsl:value-of select="12"/></xsl:when>
<xsl:otherwise><xsl:value-of select="($hours) mod 12"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="modifiedMinutes">
<xsl:choose>
<xsl:when test="$seconds > 29"><xsl:value-of select="$minutes + 1"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$minutes"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($modifiedHours, ':', $modifiedMinutes, ' ', $indicator)"/>
</xsl:template>
Change your existing code to this:
Code:
<td bgcolor="ffffff" align="center">
<xsl:call-template name="FormatTime">
<xsl:with-param name="timeString" select="Time"/>
</xsl:call-template>
</td>
Needs to be tested:)
Joe (MVP - xml)