[xquery-talk] [Dumbo question] allow us to add four minutes to a time

Michael Kay mike at saxonica.com
Thu Mar 8 01:04:54 PST 2012



On 08/03/2012 03:09, jidanni at jidanni.org wrote:
> Dear Sirs, Gentlemen,
> Let us add four minutes to a time.
>
> let $a:="12:34", $b:=4
>
> How do I return "12:38"?

xs:time(concat($a, ':00')) + xs:dayTimeDuration('PT1M') * $b

Oh, and then strip off the unwanted seconds, which you can do using 
substring(string($t), 1, 5).

Michael Kay
Saxonica


More information about the talk mailing list