When you have data given in “00:07:31″, you can use a calculator to figure it’s 451 seconds in total. It’s not really sure if there’s a better way to do in PHP but I did it this way:

[code lang=“php”]<?php $h_m_s = “00:07:31”; print(strtotime(“January 1, 1970 $h_m_s”)); ?>[/code]

The Unix timestamp begins from January 1, 1970. It is elapse time in second from January 1, 1970. For “00:07:31”, the elapse time has been 451 seconds. Do share if you have other methods that I could’ve missed.

comments powered by Disqus