RE: [GENERAL] extracting date information?

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: Kevin Heflin <kheflin(at)shreve(dot)net>, "Jose' Soares Da Silva" <sferac(at)bo(dot)nettuno(dot)it>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: RE: [GENERAL] extracting date information?
Date: 1998-05-19 18:27:02
Message-ID: F10BB1FAF801D111829B0060971D839F292EF8@dal_cps.cpsgroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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));

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Lynch 1998-05-19 18:43:13 User Authentication Failed
Previous Message Jose' Soares Da Silva 1998-05-19 17:30:14 Re: [GENERAL] extracting date information?