How can you calculate times??

Initially looking through the help file it shows the following function

=TEXT(H1-I1,"h:mm")

which calculates the diffence in hours and minutes between two times, however

if the values are 00:09:00 and 00:10:00 it won't calculate it give a #VALUE
if the values are 00:10:00 and 00:09:00 it will calculate

What am I doing wrong

Thanks in advance

Jai