Welcome Guest, Not a member yet? Register   Sign In
Global Converting unix_to_human and human_to_unix
#1

[eluser]pisio[/eluser]
Hi All !
How I can from unix time to convert in human time "1277063669" to 2010-06-20 ...
Now it's shows 2010-06-20 12:54:29 PM
I wanna see only in /user/edit page only 2010-06-20 in other pages like as /forums/topics/ 2010-06-20 12:54.....



That is my view page :
Code:
<?php
// Create 21.06.2010
// print_r($info); stdClass Object ([mail] => [email protected] [avatar] => [signature] => [rd] => 0 [active] => 0 )
$input_edit = array(
            'mail'=> array(
                    'name'=>'mail',
                    'value'=>$info->mail,
                    'type'=>'text'
                    )
                );
echo form_open("user/edit/go");
echo "Е-поща:".form_input($input_edit['mail']);
echo br();
echo "Подпис".br().form_textarea($info->signature).br();
echo unix_to_human($info->regtime);
echo form_close();
?>


and part of my user page
Code:
function edit()
    {
        if($this->session->userdata('login_in') !== 'yez')
        {
            redirect("/home",0);
        }
        
        $info = $this->db->get_where('users',array('username' => $this->session->userdata('username')));
        $info = $info->result();
        $data = array('info'=>$info[0]);
                
        $this->load->view('edit_user',$data);
    
    
    
    }
#2

[eluser]danmontgomery[/eluser]
human to unix timestamp: http://php.net/manual/en/function.strtotime.php
unix timestamp to human: http://php.net/manual/en/function.date.php
#3

[eluser]pisio[/eluser]
[quote author="noctrum" date="1277160234"]human to unix timestamp: http://php.net/manual/en/function.strtotime.php
unix timestamp to human: http://php.net/manual/en/function.date.php[/quote]

I think there is a already function.


Ok , 10x ;p


Sorry for my bad english.




Theme © iAndrew 2016 - Forum software by © MyBB