postgreSQL

Discussion in 'PHP' started by chxxangie, Nov 22, 2007.

  1. #1
    i want to send the logout time to database...
    but how to do it so that the date in database will look like that?
    2007-11-23 12:19:19.373044+08

    
     $logout_date = date('Y-m-d h:i:s');
     echo "logout date: ".$logout_date;
     $rs1 = $conn->execute($sql,array(2,$logout_date ,$_SESSION['user_id'].session_id(),$_SERVER['REMOTE_ADDR']));
    
    PHP:

     
    chxxangie, Nov 22, 2007 IP
  2. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am guessing this is the milliseconds of the transaction?

    If so there isnt really a date type to handle this. You might need to create a custom field of VARCHAR in your database to store a date in this format, although that isnt advised.

    Have you considered creating 2 fields, one for the date and one for the milliseconds using microtime()

    That way you can concatenate them as you need it.

    Good Luck :)
     
    tonybogs, Nov 23, 2007 IP