Hello,
I've got a script of facebook date but I want to translate the returning day into my language (Monday=>mmday for instance). Could you guy please.
function fb_date($timestamp){
$difference = time() - $timestamp;
$periods = array("second", "minute", "hour");
$ending=" ago";
if($difference<60){
$j=0;
$periods[$j].=($difference != 1)?"s":"";
$difference=($difference==3 || $difference==4)?"a few ":$difference;
$text = "$difference $periods[$j] $ending";
}elseif($difference<3600){
$j=1;
$difference=round($difference/60);
$periods[$j].=($difference != 1)?"s":"";
$difference=($difference==3 || $difference==4)?"a few ":$difference;
$text = "$difference $periods[$j] $ending";
}elseif($difference<86400){
$j=2;
$difference=round($difference/3600);
$periods[$j].=($difference != 1)?"s":"";
$difference=($difference != 1)?$difference:"about an ";
$text = "$difference $periods[$j] $ending";
}elseif($difference<172800){
$difference=round($difference/86400);
$periods[$j].=($difference != 1)?"s":"";
$text = "Yesterday at ".date("g:ia",$timestamp);
}else{
if($timestamp<strtotime(date("Y-01-01 00:00:00"))){
$text = date("l j, Y",$timestamp)." at ".date("g:ia",$timestamp);
}else{
$text = date("l j",$timestamp)." at ".date("g:ia",$timestamp);
}
}
return $text;
}