When you are dealing with times in PHP you would generally use a unix timestamp. A unix timestamp is always in seconds, and is always calculated from midnight (UTC) of Thursday, January 1, 1970. The Unix Timestamp could then be entered in to a database for example.
A unix timestamp can always be created in PHP using the following code below. The code below will generate the current time in seconds
<?php
$timestamp = time();
echo "Time is seconds: ". $timestamp;
?>
If you then wanted to convert this timstamp to a readable date in PHP you would use the following code
<?php
echo "Today's time and date: ". date('d-m-Y H:i:s', $timestamp);
?>
In the code above the d-m-Y displays date/month/year which is the UK format.
If you wanted to display the date in US format you would use m-d-Y
In the code above the H:i:s display the time Hours, Minutes, Seconds
It's really not that difficult dealing with times using PHP once you get your head around it.
For a start when you are dealing with time in seconds, it is a lot easier to manipulate and compare to times.
To view a live example, please click here