RE: [PHP] HELP! Date formatting
| From: | Maxim Maletsky | Date: | Wed, 17 Jan 2001 02:22:49 +0000 |
| Subject: | RE: [PHP] HELP! Date formatting | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-34958@lists.php.net to get a copy of this message | ||
$date = 30/12/1956;
$month = Array(1=>'Jan', 2=>'Feb', .... 12->'Dec');
// The array of month...
function date_format($date) {
Global $month;
$date = explode('/', $date);
// And it became to you an array...
return $date[0].'-'.$month[$date[1]].'-'.$date[2];
}
//will return 30-Dec-1956
Cheers,
Maxim Maletsky
-----Original Message-----
From: Niel Zeeman [mailto:NZeeman@BTech.co.za]
Sent: Tuesday, January 16, 2001 2:46 PM
To: php gen list
Subject: [PHP] HELP! Date formatting
Hi
Ive gotto format a date such as 30/12/1956 to format 30-Dec-1956,
I can not use mktime cause that only provides the timestamp from 1970.
Is there any other method of getting this right.
thnx
Niel Zeeman
Tel(W): (043)7014247
Cell: 082 651 4083
eMail: nzeeman@btech.co.za