Was this page helpful?

Date.AddMonths

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    date.AddMonths(datetime : str, months : num) : str

    Adds the specified number of months to a date and returns the result.  The number of months can be positive or negative. 

    Usage Restrictions

    1.9.1 or later.

    Parameters

    Name Type Description
    datetime
    str The date to which to add months.
    months
    num
    The number of months to add.

    Result

    A new date.

    Samples


    Output

    To add 3 months to the current date:

    {{ date.AddMonths(date.now, 3) }} 

    Sat, 25 Aug 2012 08:07:37 GMT

     

    To subtract 3 months from a constant date:

    {{ date.AddMonths("January, 1, 2000", -3) }} 

    Fri, 01 Oct 1999 20:00:00 +20:00

    Was this page helpful?
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by