How to use date and time in PHP

A time in PHP, representing a date and a time, is an integer, not particularly readable.  A time string, if I can coin a term, is a date and/or time in a human-readable format.

Here are some ways to get times and dates (courtesy of PHP.net's entry on strtotime):

<?php
 echo strtotime("now"), "\n";
 echo strtotime("10 September 2000"), "\n";
 echo strtotime("+1 day"), "\n";
 echo strtotime("+1 week"), "\n";
 echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";
 echo strtotime("next Thursday"), "\n";
 echo strtotime("last Monday"), "\n";
?>
Unfortunately (?), the output is a bunch of incomprehensible numbers.  But you can convert a time to a readable string thus:
<?php
$now = strtotime ("January 1, 2013");

echo "<p>Right now it's:<br>";
echo date ("Y/m/d", $now), "<br>"; 	//Prints 2013/01/1
echo date ("m-d-y", $now), "<br>"; 	//01-01-13
echo date ("D M d, Y", $now), "<br>"; 	//Thu Jan 1, 2013
echo date ("D h:i:s a", $now), "<br>"; 	//Thu 12:00:00 am
?>
For more on formatting dates, see PHP.net's entry on date.

To input a date in a form, see this code.  You could adapt it also to work for times -- I did.