Click Here To Sign In:
Log In With Aim   Log In With Google   Log In With NETLOG   Log In With OpenID   Log In With twitter   Log In With Yahoo!  

Date/Time And Timestamp Conversions In PHP:

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.

Current UNIX Timestamp: 1280654045

This UNIX timestamp is the output (or 'return value') of the php 'time()' function.

Current Date: Sunday, August 01, 2010 9:14:05

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");

Convert A Date To A UNIX Timestamp:

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.

Enter A Date:

Convert A UNIX Timestamp To A Date:

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.

Enter A Timestamp:

Latest Members:

The Man Admin WYDU All Owners Manual Enspherant