Extending that method, you'd convert the hrs to mins, add the extra mins, then subtract 'now' from 'then', optionally converting the result to hrs and mins if diff_result > 60.
Of course, this only works when the login time is in the same day as the current time. For a more general approach, you'd have to calc the date diff as well, probably using the various date format options.
Personally, if this was for a serious eg prod system, I'd likely do it in Perl as it has plenty of date calc routines.
|