XSLT Function AddMinutes

Adds a specified number of minutes to a date.

NAMESPACE

xmlns:AS="http://schema.advantages.cz/AsapFunctions"

SYNTAX

string AddMinutes(string date, string minutes)

PARAMETERS

Name Description
date Date to which minutes will be added.
minutes Number of minutes to add (if negative, minutes will be deducted).

REMARKS

Seconds and smaller parts will not be touched.

EXAMPLE

This example adds 1 minute to a source date.
Source XML

<ROOT>
    <test date="2012-03-23T16:00:00"/>
</ROOT>

COMMENT

When date is formatted by the help of AS:FormatDate - have in mind that yyyy-MM-ddThh:mm:ss is 12-hour format and yyyy-MM-ddTHH:mm:ss is 24-hour format. More info about date formats can be found here.
Stylesheet

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
    xmlns:AS="http://schema.advantages.cz/AsapFunctions" 
    xmlns:date="http://exslt.org/dates-and-times" 
    exclude-result-prefixes="AS date"> 
    <xsl:template match="/"> 
        <test test="{AS:AddMinutes(/ROOT/test/@date, 1)}"/> 
    </xsl:template> 
</xsl:stylesheet>