note 59460 deleted from function.date by nlopess
| From: | nlopess@php.net | Date: | Mon, 12 Dec 2005 19:47:20 +0000 |
| Subject: | note 59460 deleted from function.date by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100014@lists.php.net to get a copy of this message | ||
Note Submitter: ernesto dot rgb at gmail dot com
----
This is a function to spanish speakers. It works without setlocale. Is very simple and could help
anybody wants to set up dates in spanish language.
function hora(){
$ahora = time();
$dia = strftime("%A", $ahora);
$mes = strftime("%B", $ahora);
$dian = strftime("%d", $ahora);
$agno = strftime("%Y", $ahora);
$horan = strftime("%H:%M:%S", $ahora);
switch($dia){
case 'Monday': $dia="Lunes"; break;
case 'Tuesday': $dia="Martes"; break;
case 'Wednesday': $dia="Miércoles"; break;
case 'Thursday': $dia="Jueves"; break;
case 'Friday': $dia="Viernes"; break;
case 'Saturday': $dia="Sábado"; break;
case 'Sunday': $dia="Domingo"; break;
}
switch($mes){
case 'January': $mes="Enero"; break;
case 'February': $mes="Febrero"; break;
case 'March': $mes="Marzo"; break;
case 'April': $mes="Abril"; break;
case 'May': $mes="Mayo"; break;
case 'June': $mes="Junio"; break;
case 'July': $mes="Julio"; break;
case 'August': $mes="Agosto"; break;
case 'September': $mes="Septiembre"; break;
case 'October': $mes="Octubre"; break;
case 'November': $mes="Noviembre"; break;
case 'December': $mes="Diciembre"; break;
}
echo $dia.", ".$dian." "."de
".$mes." "."de ".$agno.", "."a las ".$horan;
}