BUG : Postgres Date Problem (and fix)

Kevin Stussman <[email protected]>
Newsgroups gmane.comp.audio.netjuke.user
Organization Solium Capital Inc
Message-ID <[email protected]>
Anyone using postgres might notice that the "last login" date for a user
will be something like this on the user admin page:

Last login: 1969-12-31 16:59:59

This is because php cannot parse the Postgresql date : 

2003-03-27 12:50:53.543302-07

This is the standard date format for postgreql. When PHP runs this
through the date("Y-m-d H:i:s",strtotime($field[5])) function (as is
done in user-list.php), I believe it just chokes.

The fix is to use something like :

SELECT email, name, nickname, created, login_cnt,
date_trunc('second',last_login)

in the SQL....of course, this might not be the best solution for
non-postgres people :-)

Regards,

Kevin


-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb: 
Dedicated Hosting for just $79/mo with 500 GB of bandwidth! 
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.