HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP date_timestamp_set() Function

PHP Date/Time PHP Date/Time Reference

Example

Set the date and time based on a Unix timestamp:

<?php
$date=date_create();
date_timestamp_set($date,1371803321);
echo date_format($date,"U = Y-m-d H:i:s");
?>

Run example »

Definition and Usage

The date_timestamp_set() function sets the date and time based on a Unix timestamp.


Syntax

date_timestamp_set(object,unixtimestamp);

Parameter Description
object Required. Specifies a DateTime object returned by date_create(). This function modifies this object
unixtimestamp Required. Specifies a Unix timestamp representing the date

Technical Details

Return Value: Returns the DateTime object for method chaining. FALSE on failure
PHP Version: 5.3+


PHP Date/Time PHP Date/Time Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE