Re: Week number - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: Week number
Date
Msg-id GNELIHDDFBOCMGBFGEFOMEJICAAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Week number  ("Wodzu" <wodzu@wodzus.prv.pl>)
List pgsql-hackers
In 7.1.x, try:

SELECT EXTRACT (WEEK FROM CURRENT_DATE);

in older postgres maybe this:

SELECT EXTRACT (WEEK FROM DATE 'today');

Chris

> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Wodzu
> Sent: Wednesday, 28 November 2001 8:10 PM
> To: pgsql-hackers@postgresql.org
> Subject: [HACKERS] Week number
> 
> 
> Hi all,
> 
> I'm novice in PostgreSQL.
> I want to obtain current week number.
> Under PHP I try:
> 
> $query = "SELECT EXTRACT(WEEK FROM NOW)";
> $result= pg_exec($dbconn,$query);
> 
> where: $dbconn - successful conection id
> But this give me an error message.
> Can somebody help me?
> Sorry for my english.
> 
> Thanks in advice.
> 
> Wodzu
> 
> 
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 



pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Week number
Next
From: Thomas Lockhart
Date:
Subject: Re: 7.2beta3 on Digital Alpha