note 109246 added to function.date
| From: | AndyRixon | Date: | Fri, 29 Jun 2012 09:44:09 +0000 |
| Subject: | note 109246 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188966@lists.php.net to get a copy of this message | ||
Just lately I have been wanting to convert a Unix Timestamp into a readable date and time, and
there's not many places around that can help you to archive this, so here is a bit of code that
will allow you to convert the Unix Timestamp into a more more readable date and time.
<?php
// Get the timestamp
$timestamp = "1340892242";
// Convert the timestamp
$date = date("D, d M Y", $timestamp);
$time = date("H:i:s", $timestamp);
// Echo out the timestamp
echo "<strong>Date: </strong>".$date."<br/ >";
echo "<strong>Time: </strong>".$time;
?>
=================
RESULT
=================
Date: Thu, 28 Jun 2012
Time: 09:04:02
=================
----
Server IP: 69.147.83.197
Probable Submitter: 90.217.122.70
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/109246
Del: integrated -- https://master.php.net/note/delete/109246/integrated
Del: useless -- https://master.php.net/note/delete/109246/useless
Del: bad code -- https://master.php.net/note/delete/109246/bad+code
Del: spam -- https://master.php.net/note/delete/109246/spam
Del: non-english -- https://master.php.net/note/delete/109246/non-english
Del: in docs -- https://master.php.net/note/delete/109246/in+docs
Del: other reasons-- https://master.php.net/note/delete/109246
Reject -- https://master.php.net/note/reject/109246
Search -- https://master.php.net/manage/user-notes.php