RE: [GENERAL] extracting date information?
Jackson, DeJuan <djackson@cpsgroup.com>
From: "Jackson, DeJuan" <djackson@cpsgroup.com>
To: Kevin Heflin <kheflin@shreve.net>, "Jose' Soares Da Silva" <sferac@bo.nettuno.it>
Cc: pgsql-general@postgreSQL.org
Date: 1998-05-19T18:27:02Z
Lists: pgsql-general
> > If you use "datetime" type instead of "date" and set datestyle =
> 'Postgres'
> > your data will be like: Sat Dec 12 00:00:00 1998 CET
> > instead of: 1998-12-12
>
> I actually stumbled across this after my initial post.
>
> Now that my dates are being retreived in this format:
> Sat Dec 12 00:00:00 1998 CET
>
> Is there a way to format this to leave off the "time" portion and
> maybe
> the "timezone" info ?
>
Since you're using php why don't you try (with you date datatype):
$date = '1998-05-05';
list($year, $mon, $day) = explode('-', $date);
echo $date('l M d, Y', mktime(0,0,0,$mon, $day, $year));