This interactive tutorial allows you to view the results of converting a date to a UNIX timestamp, or a UNIX timestamp to a date, using common PHP functions.
The tutorial also provides sample code for generating many common date formats from a UNIX timestamp.
The following forms and samples should help you to understand the use of the php functions 'date()', 'time()' and 'strtotime()' to handle date and time information in your php code.
This UNIX timestamp is the output (or 'return value') of the php 'time()' function.
This formatted date is the output (or 'return value') of the php 'date()' function when invoked with the followng code:
$output_date = date ("l, F d, Y G:i:s", "1280654045");
You can enter a date in any date format recognized by the php 'strtotime()' function and the script will return the UNIX timestamp for the date you provide, along with the sample php code used to generate the timestamp.
You can enter a UNIX timestamp into the following field. This script will return several common date formats. You will be shown the code required to generate each format using the php 'date'() function and the timestamp you provide.