pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedTimezone
6+ messages / 2 participants
[nested] [flat]
* Timezone
@ 2002-07-30 20:32 angelo.rigo@globo.com
0 siblings, 0 replies; 6+ messages in thread
From: angelo.rigo@globo.com @ 2002-07-30 20:32 UTC (permalink / raw)
To: pgsql-php
Hi
i would like to show the date a record was entered i choose my data type
to be timezone , how can i change the timezone to match the Brazilian timezone
format?
Thank?s in advance
Ângelo Rigo
________________________________________
A busca mais veloz e precisa da internet. Acesse agora: http://www.zoom.com.br.
^ permalink raw reply [nested|flat] 6+ messages in thread
* timezone
@ 2002-08-01 18:11 angelo.rigo@globo.com
2002-08-01 18:14 ` Re: timezone Josh Berkus <josh@agliodbs.com>
0 siblings, 1 reply; 6+ messages in thread
From: angelo.rigo@globo.com @ 2002-08-01 18:11 UTC (permalink / raw)
To: pgsql-php
how can i change the display format o a timezone field?
i want it to be brazilian format or latin american.
________________________________________
A busca mais veloz e precisa da internet. Acesse agora: http://www.zoom.com.br.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: timezone
2002-08-01 18:11 timezone angelo.rigo@globo.com
@ 2002-08-01 18:14 ` Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 6+ messages in thread
From: Josh Berkus @ 2002-08-01 18:14 UTC (permalink / raw)
To: angelo.rigo@globo.com; pgsql-php
Angelo,
> how can i change the display format o a timezone field?
> i want it to be brazilian format or latin american.
Use the "to_char" function to format the time zone, for example:
SELECT to_char(some_date, 'DD.MM.YYYY');
some_date
-----------------
16.04.2002
--
-Josh Berkus
Aglio Database Solutions
San Francisco
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: timezone
@ 2002-08-01 18:44 Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 6+ messages in thread
From: Josh Berkus @ 2002-08-01 18:44 UTC (permalink / raw)
To: angelo.rigo@globo.com; +Cc: pgsql-php
Angelo,
> So simple!
> thank?s Josh
>
> in my case i do :
> -- SELECT nome, data FROM aprovados order by nome asc --
> -- printf ("<tr bgcolor='$bgcolor'><td>%s</td><td>%s</td></tr>
> ",$myrow[nome], $myrow[data]); --
>
> the select goes like this?
>
> -- SELECT nome, data to char (??some_date??, 'DD.MM.YYYY');FROM aprovados
> order by nome asc --
that would be:
SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
FROM aprovados
ORDER BY nome ASC;
--
-Josh Berkus
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: timezone
@ 2002-08-01 19:09 Josh Berkus <josh@agliodbs.com>
2002-08-01 19:48 ` Re: timezone angelo.rigo@globo.com
0 siblings, 1 reply; 6+ messages in thread
From: Josh Berkus @ 2002-08-01 19:09 UTC (permalink / raw)
To: angelo.rigo@globo.com; +Cc: pgsql-php
Angelo,
> how can i display 20 results at a time and give a link to the next 20 or
> 50 or whatever records i do have on the database?
Use LIMIT and OFFSET, which work the same in Postgres and MySQL:
SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
FROM aprovados
ORDER BY nome ASC
LIMIT 20 OFFSET 0;
then
SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
FROM aprovados
ORDER BY nome ASC
LIMIT 20 OFFSET 20;
etc.
--
-Josh Berkus
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: timezone
2002-08-01 19:09 Re: timezone Josh Berkus <josh@agliodbs.com>
@ 2002-08-01 19:48 ` angelo.rigo@globo.com
0 siblings, 0 replies; 6+ messages in thread
From: angelo.rigo@globo.com @ 2002-08-01 19:48 UTC (permalink / raw)
To: josh@agliodbs.com; +Cc: pgsql-php
it displays 20 but have no link to next records
how can i add it?
'>'-- Mensagem Original --
'>'From: Josh Berkus <josh@agliodbs.com>
'>'Reply-To: josh@agliodbs.com
'>'To: angelo.rigo@globo.com
'>'Subject: Re: [PHP] timezone
'>'Date: Thu, 1 Aug 2002 12:09:19 -0700
'>'Cc: pgsql-php@postgresql.org
'>'
'>'
'>'Angelo,
'>'
'>'> how can i display 20 results at a time and give a link to the next
20 or
'>'> 50 or whatever records i do have on the database?
'>'
'>'Use LIMIT and OFFSET, which work the same in Postgres and MySQL:
'>'
'>'SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
'>' FROM aprovados
'>' ORDER BY nome ASC
'>' LIMIT 20 OFFSET 0;
'>'
'>'then
'>'
'>'SELECT nome, to_char(data, 'DD.MM.YYYY') AS data
'>' FROM aprovados
'>' ORDER BY nome ASC
'>' LIMIT 20 OFFSET 20;
'>'
'>'etc.
'>'
'>'--
'>'-Josh Berkus
'>'
'>'______AGLIO DATABASE SOLUTIONS___________________________
'>' Josh Berkus
'>' Complete information technology josh@agliodbs.com
'>' and data management solutions (415) 565-7293
'>' for law firms, small businesses fax 621-2533
'>' and non-profit organizations. San Francisco
'>'
'>'
'>'---------------------------(end of broadcast)---------------------------
'>'TIP 4: Don't 'kill -9' the postmaster
________________________________________
A busca mais veloz e precisa da internet. Acesse agora: http://www.zoom.com.br.
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2002-08-01 19:48 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-30 20:32 Timezone angelo.rigo@globo.com
2002-08-01 18:11 timezone angelo.rigo@globo.com
2002-08-01 18:14 ` Re: timezone Josh Berkus <josh@agliodbs.com>
2002-08-01 18:44 Re: timezone Josh Berkus <josh@agliodbs.com>
2002-08-01 19:09 Re: timezone Josh Berkus <josh@agliodbs.com>
2002-08-01 19:48 ` Re: timezone angelo.rigo@globo.com
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox