Re: What day is it - when it isn't NOW()?
От | Josh Berkus |
---|---|
Тема | Re: What day is it - when it isn't NOW()? |
Дата | |
Msg-id | 200308011128.25461.josh@agliodbs.com обсуждение исходный текст |
Ответ на | What day is it - when it isn't NOW()? (tomg@sqlclinic.net) |
Ответы |
Re: What day is it - when it isn't NOW()?
|
Список | pgsql-sql |
Thomas, > SELECT to_char(now(), 'Day'); returns Friday as I'd hoped. > But how do I return the day of the week for a specific date other > than now()? I'm looking for something along the lines of: > SELECT to_char('2003-08-04', 'Day') without much success. > > Can anyone point me to the right function/combination of functions > to achieve this? Well, you could try the online docs under "Functions and operators" <grin>. Two possibilities: SELECT to_char('2003-08-04'::TIMESTAMP, 'Day') should make the to_char version work for you. Alternately, SELECT EXTRACT(dow FROM '2003-08-04') will give you a numerical (0-6) day of the week. -- Josh Berkus Aglio Database Solutions San Francisco
В списке pgsql-sql по дате отправления: