Was this page helpful?

Date.Compare

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

    Compare the first date-time to the second date-time. 

    Usage Restrictions

    1.9.1 or later.

    Parameters

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

    Result

    Less than zero:  the first date is less than the second date.
    Zero: the first date and the second date are equal.
    Greater than zero:  the first date is greater than the second date.

    Samples


    Output

    To compare today to 01/01/2000:

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

    1

     

     

    To compare a date with itself:

    {{ date.Compare("01/01/2000", "01/01/2000") }} 

    0

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

    Copyright © 2011 MindTouch, Inc. Powered by