RE: newbie:how can i get day of week data type... - Mailing list pgsql-general

From Tamsin
Subject RE: newbie:how can i get day of week data type...
Date
Msg-id NEBBKHBOBMJCHDMGKCNJIEIACPAA.tg_mail@bryncadfan.co.uk
Whole thread Raw
In response to newbie:how can i get day of week data type...  ("Muhammad Rusydi" <rusydi@cbn.net.id>)
List pgsql-general
use the date_part function:

test=# select date_part('dow',current_timestamp);
 date_part
-----------
         4
(1 row)

or:

select date_part('dow',day) from schedule;

where 'dow' is the day of week.

see the user docs for other date/time functions

hth
tamsin

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Muhammad Rusydi
> Sent: 14 June 2001 11:24
> To: postgres general
> Subject: [GENERAL] newbie:how can i get day of week data type...
>
>
> i've created this table:
> create table schedule (
> day date,
> tm timestamp,
> room char(4));
>
> insert into schedule values ('20/06/2001','08:00:00','A104');
>
> my problem is how to get day of week information from date or is there any
> way to do this?
> would you show me how to do it?
> thank's
> Didi
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>


pgsql-general by date:

Previous
From: "Muhammad Rusydi"
Date:
Subject: newbie:how can i get day of week data type...
Next
From: Einar Karttunen
Date:
Subject: Re: OIDs overflow