1 Apr 2003 04:02
BUG : Postgres Date Problem (and fix)
Kevin Stussman <kevins <at> solium.com>
BUG : Postgres Date Problem (and fix)
2003-04-01 02:02:05 GMT
BUG : Postgres Date Problem (and fix)
2003-04-01 02:02:05 GMT
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/
(Continue reading)
RSS Feed