Category: >> PHP Code >> Calculate the difference between two times formatted in HH:MM Bookmark and Share

<< lastnext >>

Snippet Name: Calculate the difference between two times formatted in HH:MM

Description: A script that calculates the difference between two times, formatted in HH:MM. For example, if you enter 23:40 and 01:30, it will calculate it as a time difference of "01:50".

Also see:
» Convert Minutes to Days, Hours, an...
» LDAP Timestamp Converter
» Time left In Weeks, Days, Hours, A...
» Get Relative Dates and Times
» Convert Seconds to Hours:Minutes:S...
» %TYPE vs %ROWTYPE - What's the dif...
» Convert Minutes to Hours
» Convert Hours to Minutes
» Convert 12 to 24 hour time and vic...
» Calculate time difference between ...
» Show Runtime in days and hours
» Days in month #2
» Days in month #1
» Convert minutes to hours #2
» Convert minutes to hours #1

Comment: (none)

Author: CoderZone
Language: PHP
Highlight Mode: PHP
Last Modified: May 14th, 2010

echo getTimeDiff("23:30","01:30");
function getTimeDiff($dtime,$atime){
 return $hours.':'.$mins.':'.$secs;
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© | users online: 5