By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,203 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,203 IT Pros & Developers. It's quick & easy.

day from date

P: 1
Is there a function in postgresql to find weekday from date?
E.g. Given 2008-09-08 , it returns Monday.
Sep 8 '08 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 700
I do not hear about that function but you can write a simple query

Expand|Select|Wrap|Line Numbers
  1. Select case extract(dow from '2008-09-08'::date)
  2. when 0 then 'Sunday'
  3. when 1 then 'Monday'
  4. when 2 then 'Tuesday'
  5. when 3 then 'Wednesday'
  6. when 4 then 'Thursday
  7. when 5 then 'Friday'
  8. when 6 then 'Saturday'
  9. end;
  10.  
Sep 8 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.