Thread: weekday from timestamp?
im strugling with my dataset.. got a small pgsql db with a timestamp column in format YYYY:MM:DD HH:MM:SS for each record how could i possibly return day of the week for every record? any help will be much appreciated cheers r
> -----Original Message----- > From: pgsql-general-owner@postgresql.org [mailto:pgsql-general- > owner@postgresql.org] On Behalf Of ..::rDk::.. > Sent: Sunday, September 07, 2008 8:08 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] weekday from timestamp? > > im strugling with my dataset.. > > got a small pgsql db with a timestamp column in format YYYY:MM:DD > HH:MM:SS for each record > > how could i possibly return day of the week for every record? http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html
..::rDk::.. wrote: > im strugling with my dataset.. > > got a small pgsql db with a timestamp column in format YYYY:MM:DD > HH:MM:SS for each record Use to_char to_char(tscol, 'dy') -> mon to_char(tscol, 'Day') -> Monday to_char(tscol, 'D') -> 2