Re: date with month and year - Mailing list pgsql-general

From Paul Jungwirth
Subject Re: date with month and year
Date
Msg-id 555E122F.9050307@illuminatedcomputing.com
Whole thread Raw
In response to date with month and year  (Daniel Torres <nobeeakon@gmail.com>)
List pgsql-general
> Is it possible to have date type data that only contain month and year?,
> how can I obtain that from a timestamp (without time zone) column?

I think you want date_trunc, which will cut everything down to the first
of the month, e.g 2015-01-01, 2015-02-01, etc. The results will still be
dates, so you can still use date functions to manipulate them.

Paul






pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: date with month and year
Next
From: "Joshua D. Drake"
Date:
Subject: Re: date with month and year