Re: Date Parse

From: "postgresql" <pgsql(at)symcom(dot)com>
To: "Paulo J(dot) Matos" <pocm(at)rnl(dot)ist(dot)utl(dot)pt>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Date Parse
Date: 2002-01-30 00:59:39
Message-ID: 200201300042.g0U0gul96727@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Paulo,

given your_table has a column called date_col.

SELECT to_char(date_col, 'Month') FROM your_table WHERE
something is true;
Will give you a response of the month spelled out. Change the
'Month' to 'MM' and you get a two character string from 01 to 12 for the
month. Change it to 'month' and you get a lower case month,
(january).

check the docs on formatting:
http://www.postgresql.org/idocs/index.php?functions-formatting.html

Ted

-----Original Message-----
From: pocm(at)rnl(dot)ist(dot)utl(dot)pt (Paulo J. Matos)
To: pgsql-sql(at)postgresql(dot)org
Date: 30 Jan 2002 00:04:18 +0000
Subject: [SQL] Date Parse

> Hi all,
>
> I have a field in a table of type date.
> In a results set I get some dates. How can I access the month in
> those dates?
>
> Best regards,
>
> --
> Paulo J. Matos : pocm(_at_)rnl.ist.utl.pt
> Instituto Superior Tecnico - Lisbon
> Software & Computer Engineering - A.I.
> - > http://www.rnl.ist.utl.pt/~pocm
> ---
> Yes, God had a deadline...
> So, He wrote it all in Lisp!
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

  • Date Parse at 2002-01-30 00:04:18 from Paulo J. Matos

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Ruprecht 2002-01-30 01:10:00 Re: Date Parse
Previous Message Andrew G. Hammond 2002-01-30 00:45:51 Re: Date Parse