Re: Funcion determinar dias

From: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
To: Julio Rivero <jcrmlima(at)gmail(dot)com>
Cc: pgsql-es postgresql <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Funcion determinar dias
Date: 2005-04-28 16:22:13
Message-ID: m34qdq27nu.fsf@conexa.fciencias.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Julio Rivero <jcrmlima(at)gmail(dot)com> writes:

> Hola Lista:
> Una consulta, algo rápida, alguien sabe si PG tiene alguna funcion para
> determinar si un año es bisciesto???,

No creo, pero es trivial de hacer, algo como

create or replace function bisisesto(int) returns boolean as $$
begin
if (((($1 % 4) = 0) AND (($1 % 100) <> 0)) OR (($1 % 400) = 0)) THEN
return true;
end if;
return false;
end;
$$ language 'plpgsql';

Saludos,
Manuel.

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Cesar Alvarado 2005-04-28 16:37:32 Error en Instacion sobre Windows2000
Previous Message Sebastián Villalba 2005-04-28 16:20:55 Permisos sobre funciones y no sobre tablas