codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  difference of two time  Archive Import (diego) at 22:37 on Tuesday, July 22, 2003
 

i applied an overtime from 5:48 PM 7/21/2003 to 2:00 AM 7/22/2003. how can i get the total number of hours including minutes.


  Re: difference of two time  Archive Import (anonymous) at 13:52 on Tuesday, July 29, 2003
 

datediff(Minute,dateTime1, dateTime2)
will return the number of minutes, to get the number of hours, use the above function / 60
to get the minutes in the hour, take the above function MOD 60

Since datediff and the / 60 are both integers I _assume_ an integer return type, but I haven`t tried it before.

Hope this works,
-Mike

  Re: difference of two time  Archive Import (anonymous) at 13:57 on Tuesday, July 29, 2003
 

By the way, if by change datediff(...) / 60 doesn`t return an integer you can always use the FLOOR(datediff(...) / 60) to get the integer result.

-Mike

  Re: difference of two time  Elain at 14:29 on Tuesday, November 09, 2010
 

I think the answer should be 8 hour and 26 mininuts, isn't it?
--------------------------------------------------------------
flash banner | logo maker | flash menu | drop down menu









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: open excel file in html page
•  Re: Connection Problem help needed
•  Re: Open Excel in HTML page
•  Re: losing session between servlets
•  Re: Modifying Excel files
•  Re: insert picture into email
•  Join DZone Q&A webcast with Chris Hostetter
•  delete a lots of records
•  Re: add 6 working days


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010