From: | "Tamsin" <tg_mail(at)bryncadfan(dot)co(dot)uk> |
---|---|
To: | "postgres general" <pgsql-general(at)postgresql(dot)org> |
Subject: | RE: newbie:how can i get day of week data type... |
Date: | 2001-06-14 10:49:16 |
Message-ID: | NEBBKHBOBMJCHDMGKCNJIEIACPAA.tg_mail@bryncadfan.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)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
>
From | Date | Subject | |
---|---|---|---|
Next Message | Einar Karttunen | 2001-06-14 12:06:23 | Re: OIDs overflow |
Previous Message | Muhammad Rusydi | 2001-06-14 10:23:53 | newbie:how can i get day of week data type... |