Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob Watkins 369 posts 701 karma points
    Nov 25, 2010 @ 18:10
    Rob Watkins
    0

    Exslt date:add($date, 'P1M') just adds 30 days

    <xsl:value-of select="date:add('2010-10-01', 'P1M')"/><br/>
    <xsl:value-of select="date:add('2010-07-01', 'P1M')"/><br/>
    <xsl:value-of select="date:add('2010-02-01', 'P1M')"/><br/>
    <xsl:value-of select="date:add('2010-09-01', 'P1M')"/>

    ...gives:

    2010-10-31T00:00:00

    2010-07-31T00:00:00

    2010-03-03T00:00:00

    2010-10-01T00:00:00

    This is not useful. Is there actually a way of adding a month short of splitting the date myself? Or am I missing something obvious?

  • Rob Watkins 369 posts 701 karma points
    Nov 25, 2010 @ 18:15
    Rob Watkins
    1

    Hmm, should have done a bit more digging, but ah well, may this post will help someone else :o)

    If you use the Umbraco library function it works fine:

    <xsl:value-of select="umbraco.library:DateAdd('2010-10-01', 'm', 1)"/>

    ...gives:

    2010-11-01T00:00:00

    (and the other moths including Feb work the same)

  • jonok 297 posts 658 karma points
    Aug 04, 2011 @ 04:10
    jonok
    0

    Great stuff - this just helped me a lot. Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft