datetime problems

From: Memphisto <szoli(at)valerie(dot)inf(dot)elte(dot)hu>
To: PostgreSQL mailinglist <pgsql-general(at)postgreSQL(dot)org>
Subject: datetime problems
Date: 1998-10-21 11:50:36
Message-ID: Pine.GSO.3.96.981021133209.13780C-100000@valerie.inf.elte.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'd like to issue a query that lists all the rows of a table whose 'date'
columns(its type is datetime) is falls in a month, i.e. these rows were
inserted in , say August. How can I do that?

When I bugged with that problem I found an interesting bug:
elmu=> select date_trunc('month','now'::datetime);
date_trunc
-----------------------------
Thu Oct 01 00:00:00 1998 CEST
(1 row)

That's OK.

elmu=> select date_trunc('month','now'::datetime) + timespan('1
month'::reltime)
;
?column?
----------------------------
Sat Oct 31 23:00:00 1998 CET
(1 row)

Why not Nov 1?

--------------------------------------------------------------------------------
Sebestyén Zoltán AKA Memphisto It all seems so stupid,
it makes me want to give up.
szoli(at)neumann(dot)cs(dot)elte(dot)hu But why should I give up,
when it all seems so stupid?

MAKE INSTALL NOT WAR And please avoid Necrosoft Widows

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Memphisto 1998-10-21 11:57:00 That bug I mention in my prev. letter
Previous Message Przemyslaw Bak 1998-10-21 10:50:14 Re: [GENERAL] jdbc + postgres