Was this page helpful?

Date.DiffMonths

    Table of contents
    1. 1. Usage Restrictions
    2. 2. Parameters
    3. 3. Result
    4. 4. Samples
    date.DiffMonths(first : str, second : str) : num

    Compute the difference between the first and second date in months. 

    Usage Restrictions

    1.9.1 or later.

    Parameters

    Name Type Description
    first str The first date.
    second str The second date.

    Result

    The difference between the first and second date in months.

    Samples

      Output

    To display the difference in months between today and a month from now:

    {{ date.DiffMonths(date.now, date.AddMonths(date.now, 1)) }} 

    -1

    To display the difference in months between today and 01/01/2000:

    {{ date.DiffMonths(date.now, "01/01/2000") }} 

    148

     

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

    Copyright © 2011 MindTouch, Inc. Powered by