Re: Week number - Mailing list pgsql-hackers

From Jason Earl
Subject Re: Week number
Date
Msg-id 87wv0an8tm.fsf@npa01zz001.simplot.com
Whole thread Raw
In response to Week number  ("Wodzu" <wodzu@wodzus.prv.pl>)
List pgsql-hackers
Both

SELECT extract(week FROM now());

and

SELECT extract(week FROM CURRENT_TIMESTAMP);

work as expected.  I don't know which is the *accepted* SQL 92
idiom, but I would bet that it isn't 'now().'

Jason

"Wodzu" <wodzu@wodzus.prv.pl> writes:

> 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: Doug McNaught
Date:
Subject: Re: FW: [ppa-dev] Severe bug in debian - phppgadmin opens up
Next
From: Luis Amigo
Date:
Subject: Re: Call for platform testing