title besides title

 

Saturday, November 24, 2012

PHP : Dates and Times - [3.4] Converting an Epoch Timestamp to Time and Date Parts

3.4.1 Problem

You want the set of time and date parts that corresponds to an epoch timestamp.

3.4.2 Solution

Pass an epoch timestamp to getdate( ):
$time_parts = getdate(163727100);

3.4.3 Discussion

The time parts returned by getdate( ) are detailed in Table 3-1. These time parts are in local time. If you want time parts in another time zone corresponding to a particular epoch timestamp, see Section 3.12.