Hola.
You can use the format as you want, for any international standard. Simply reformat the date, using the same setup.
http://www.php.net/manual/en/function.date.php has a long list of formatting components. 'd' for example is day of the month.
Any symbols or other characters that are NOT already used as part of the formatting will be displayed. For example, 'd:d' would output '01:01' if it was the first day of the month.
If you want to standardize the input, you can use $var = time() to get the current timestamp.
From $that, you can use date('format',$that); and output in any format you'd like.
If you are talking about actually translating words, such as days of the week, you will want to create a replacement system for the string, as I don't think that PHP has any default translation for time like that.
PHP Code:
$todayis = date(...);
$dias = array(
'monday'=>'lunes',
'tuesday'=>'martes',
'wednesday'=>'miercoles',
'thursday'=>'jueves',
'friday'=>'viernes',
'saturday'=>'sabado',
'sunday'=>'domingo'
);
$hoyes = strtolower($todayis); //eliminate any weird capital letters
foreach ($dias as $en=>$es) {
$hoyes = str_replace($en,$es,$hoyes);
}
//$hoyes ahora esta el tiempo en espaņol
Bookmarks