Was this page helpful?

Date.DiffHours

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

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

    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 hours.

    Samples


    Output

    To display the difference in hours between today and tomorrow:

    {{ date.DiffHours(date.now, date.AddDays(date.now, 1)) }} 

    -24

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

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

    108680.2575

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

    Copyright © 2011 MindTouch, Inc. Powered by