Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] xslt2 time format: 2.00pm to display "2pm"

From: "Andrew Welch" <andrew.j.welch@--------->
To:
Date: 11/1/2007 3:19:00 PM
On 01/11/2007, David Murphy <david@xxxxxxxxxxxxxx> wrote:
> Hello
>
> We need to be able to display time, for example, as "2.14pm" but if it's
> exactly 2:00pm we need to be able to display this as "2pm"
>
> Is there a way to do this without having to search for ".00" in the
> string and unceremoniously removing it? :)

You could check if the minutes component is equal to zero:

minutes-from-time($t) = 0

and then use an appropriate picture string in format-time():

format-time($t,'[h1][Pm]')

the alternative being:

format-time($t,'[h1].[m01][Pm]')


cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent