Page 1 of 1

Subtract Time from string

Posted: Mon Jan 29, 2007 9:27 am
by shiznatix
Please dont kill me as I couldnt find the answer in searching.

I have 2 strings, say "3:00 AM" and "4:30 PM"

I need to be able to be like: "time worked was 13.5 hours"

is there an easy way to get that 13.5?

Posted: Mon Jan 29, 2007 9:30 am
by feyd
strtotime() may be able to help, but you may end up having to parse or translate the text first (or alternately.)

Posted: Mon Jan 29, 2007 10:02 am
by shiznatix
i feared that would be the case. oh well best start now