Thứ Năm, 7 tháng 8, 2014

Convert_time($time) mysql_format to timestamp


function convert_time($time){
        if(!$time) return false;
        $array1=explode(" ",$time);
        $array2["date"]=explode("-",$array1[0]);
        $array2["time"]=explode(":",$array1[1]);           
        $int_time=mktime($array2["time"][0],$array2["time"][1],$array2["time"][2],$array2["date"][1],$array2["date"][2],$array2["date"][0]);
        if($int_time)
            return $int_time;
        else
            return false;
    }

---- ngay - thang - nam ( show )
 date("d/F/Y h:i:s",convert_time($value['time']));

links: http://php.net/manual/en/function.date.php

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

Đăng nhận xét