Skip site navigation (1) Skip section navigation (2)

Re: Week number

From: Jason Earl <jason(dot)earl(at)simplot(dot)com>
To: "Wodzu" <wodzu(at)wodzus(dot)prv(dot)pl>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Week number
Date: 2001-11-28 16:45:09
Message-ID: 87wv0an8tm.fsf@npa01zz001.simplot.com (view raw or flat)
Thread:
Lists: 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(at)wodzus(dot)prv(dot)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

In response to

pgsql-hackers by date

Next:From: Doug McNaughtDate: 2001-11-28 16:46:20
Subject: Re: FW: [ppa-dev] Severe bug in debian - phppgadmin opens up
Previous:From: Vincent.GaboriauDate: 2001-11-28 16:44:50
Subject: Re: [HACKERS] upper and lower doesn't work with german

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group