Re: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date - Mailing list pgsql-sql

From Bricklen Anderson
Subject Re: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date
Date
Msg-id 48908735.4010601@presinet.com
Whole thread Raw
In response to Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date  (Emi Lu <emilu@encs.concordia.ca>)
Responses Re: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date
List pgsql-sql
Emi Lu wrote:
> 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!
> 

http://www.postgresql.org/docs/current/static/functions-formatting.html


select to_char(current_date,'Day');
select to_char(current_date,'D');


pgsql-sql by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Get day name(Mon, Tue... Sun) and day number (1, 2...7) from a date
Next
From: Michael Toews
Date:
Subject: order function in aggregate