From: Martin Marques <martin@bugs.unl.edu.ar>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Creager <Robert_Creager@LogicalChaos.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: inverse of "day of year"
Date: Mon, 22 Mar 2004 08:32:32 -0300
Message-ID: <200403220832.32968.martin@bugs.unl.edu.ar> (raw)
In-Reply-To: <24189.1079709005@sss.pgh.pa.us>
References: <200403190906.17641.martin@bugs.unl.edu.ar>
<20040319064714.405b304e.Robert_Creager@LogicalChaos.org>
<24189.1079709005@sss.pgh.pa.us>
El Vie 19 Mar 2004 12:10, Tom Lane escribió:
> Robert Creager <Robert_Creager@LogicalChaos.org> writes:
> > Martin Marques <martin@bugs.unl.edu.ar> confessed:
> >> Is there a function that would give me the date for a given day of year?
> >
> > Something like:
> >
> > select date_trunc( 'year', now() ) + (extract( doy from now() ) - 1) *
> > '1day'::interval;
>
> timestamp + interval arithmetic is likely to give you problems at
> daylight savings boundaries, since '1day' will be taken as '24hours'.
Is there information on how other intervals are taken? I mean, how is '1 year'
afected with the leap years?
--
08:30:01 up 13 days, 13:01, 3 users, load average: 2.04, 1.80, 1.04
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: martin@bugs.unl.edu.ar, tgl@sss.pgh.pa.us, Robert_Creager@LogicalChaos.org
Subject: Re: inverse of "day of year"
In-Reply-To: <200403220832.32968.martin@bugs.unl.edu.ar>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox