note 72953 added to function.date
| From: | cj at 407x dot com | Date: | Mon, 05 Feb 2007 19:43:12 +0000 |
| Subject: | note 72953 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122891@lists.php.net to get a copy of this message | ||
This is a very simple few lines of code to display dates that arrive in various formats:
$dateArray=explode('-','2007-02-05');
// $dateArray[0]= 2007
// $dateArray[1] = 02
// $dateArray[2] = 05
echo date('M j, Y', mktime(0, 0, 0, $dateArray[1], $dateArray[2], $dateArray[0]));
// result: Feb 2, 2007
alter your explode characters and dateArray positions to suit.
Chris
----
Server IP: 64.71.164.2
Probable Submitter: 216.176.226.161
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- https://master.php.net/note/edit/72953
Del: integrated -- https://master.php.net/note/delete/72953/integrated
Del: useless -- https://master.php.net/note/delete/72953/useless
Del: bad code -- https://master.php.net/note/delete/72953/bad+code
Del: spam -- https://master.php.net/note/delete/72953/spam
Del: non-english -- https://master.php.net/note/delete/72953/non-english
Del: in docs -- https://master.php.net/note/delete/72953/in+docs
Del: other reasons-- https://master.php.net/note/delete/72953
Reject -- https://master.php.net/note/reject/72953
Search -- https://master.php.net/manage/user-notes.php