35 lines
784 B
PHP
35 lines
784 B
PHP
<?php
|
|
Class Zend_View_Helper_NewsDate extends Zend_View_Helper_Abstract
|
|
{
|
|
protected $mois = array (
|
|
'Jan' => 1,
|
|
'Feb' => 2,
|
|
'Mar' => 3,
|
|
'Apr' => 4,
|
|
'May' => 5,
|
|
'Jun' => 6,
|
|
'Jul' => 7,
|
|
'Aug' => 8,
|
|
'Sep' => 9,
|
|
'Oct' => 10,
|
|
'Nov' => 11,
|
|
'Dev' => 12,
|
|
);
|
|
|
|
public function NewsDate($date)
|
|
{
|
|
$tmp = explode(', ', $date);
|
|
$tabDate = explode(' ', $tmp[1]);
|
|
$tabTime = explode(':', $tabDate[3]);
|
|
$timestamp = gmmktime(
|
|
$tabTime[0]-1,
|
|
$tabTime[1],
|
|
$tabTime[2],
|
|
$this->mois[$tabDate[1]],
|
|
$tabDate[0],
|
|
$tabDate[2]
|
|
);
|
|
$pubDate = date('d/m/Y à H:i', $timestamp);
|
|
return $pubDate;
|
|
}
|
|
} |