Skip to main content
Participant
July 25, 2008
Question

time difference

  • July 25, 2008
  • 3 replies
  • 422 views
It seems to me that datediff only calculates difference between two dates. How about time?

Pls kindly advise.
    This topic has been closed for replies.

    3 replies

    Inspiring
    July 29, 2008
    Hi Dynason,

    Instead of using CreateDateTime, try using CreateTime.

    Example: CreateTime(hh,mm,ss)

    <p><cfoutput>
    #DateDiff('n',CreateTime(12,30,00),CreateTime(12,45,00))#
    </cfoutput></p>

    Leonard
    Inspiring
    July 25, 2008
    dynason wrote:
    > <cfoutput>
    > #DateDiff('n', CreateDateTime(0,0,0,12,30,0), CreateDateTime(0,0,0,12,45,0))#;
    > </cfoutput>

    you might have better luck w/a real date:

    <cfoutput>
    #dateDiff('n', CreateDateTime(1970,1,1,12,30,0), CreateDateTime(1970,1,1,12,45,0))#
    </cfoutput>




    dynasonAuthor
    Participant
    July 25, 2008
    I have tried the following but does not work!

    <cfoutput>
    #DateDiff('n', CreateDateTime(0,0,0,12,30,0), CreateDateTime(0,0,0,12,45,0))#;
    </cfoutput>