Skip site navigation (1) Skip section navigation (2)

Timestamp manipulation

From: Stephen Quinney <stephen(dot)quinney(at)computing-services(dot)oxford(dot)ac(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Timestamp manipulation
Date: 2004-03-31 10:41:27
Message-ID: (view raw or whole thread)
Lists: pgsql-sql
I am having a bit of difficulty trying to find a solution to this
problem of manipulating timestamps and dates so I hope someone can
enlighten me.

I have a table which contains a column of type timestamp. For each row
I want to find out the dates for the beginning and end of the week
within which the timestamp lies.

e.g. 2004-04-09 16:00:00+01

The beginning of the week (sunday) is:


and the end of the week (saturday) is:


Any suggestions as to how to go about this would be great, thanks in

Stephen Quinney

pgsql-sql by date

Next:From: Ivan Sergio BorgonovoDate: 2004-03-31 11:07:56
Subject: Re: plpgsql vs. SQL in stored procedures
Previous:From: Christopher BrowneDate: 2004-03-31 08:31:01
Subject: Re: plpgsql vs. SQL in stored procedures

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group