martes, 20 de agosto de 2013

Week in postgresql

select
    extract(week from now()) as num_semana,
    date_trunc('week', now()::timestamp)::date as fecha_ini_semana,
    (date_trunc('week', now()::timestamp)+ '6 days'::interval)::date as fecha_fin_semana;

No hay comentarios:

Publicar un comentario