Skip site navigation (1) Skip section navigation (2)

Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date
Date: 2008-07-30 15:08:52
Message-ID: 48908404.2040804@encs.concordia.ca (view raw or flat)
Thread:
Lists: pgsql-sql
Good morning,

Could someone tell me the command to get the weekly day name and day 
number please.


I am expecting something like:

sql> select data_part('day name', current_date);
sql> Monday

sql> select data_part('day number', current_date);
sql> 1

(Mon =1 ... Sun =7?)

Thanks a lot!

Responses

pgsql-sql by date

Next:From: Milen A. RadevDate: 2008-07-30 15:22:27
Subject: Re: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date
Previous:From: Richard HuxtonDate: 2008-07-29 21:29:50
Subject: Re: Identifying which column matches a full text search

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group