Thứ Tư, 5 tháng 3, 2014

time của bài viết

**** funtion
function viewtime($vtime,$ht) {
    global $hourdiff, $htg1, $htg2, $currentlang;
    if ($ht == 2) { $xht = $htg2; } else { $xht = $htg1; }
    $timeadjust = ($hourdiff * 60);
    $viewtime = date("$xht", $vtime + $timeadjust);   
$str_search = array ("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday","AM","PM");
$str_replace = array ("Thứ hai, ","Thứ ba, ","Thứ tư, ","Thứ năm, ","Thứ sáu, ","Thứ bảy, ","Chủ nhật, ","Sáng","Chiều");
    $timenow = str_replace( $str_search, $str_replace, $viewtime);   
    if($currentlang=='english')
        return($viewtime);
        return $timenow;
}

**** code
viewtime($data[0]["time"],2)

Không có nhận xét nào:

Đăng nhận xét