infoCopter.com
retoh's Online Repository for myself and other Web Geeks

home | newsletter | site map

Free Stuff

: links

: Neue Surf Tips

: know-how

: Zitate

: Spam Strike

: HTML Checker!

: Link Checker

: Cartoons



About IC

: friends

: lust und frust

: guestbook

: what's new

Date & Time: Know-how
See also
p-friendly
Home :: Know-how :: Date & Time: Know-how


[ up ]

postgresql/datetime-appendix.html
developer.postgresql.org/docs/postgres/functions-datetime.html

SET TIMEZONE TO 'PST';
SET TIMEZONE TO 'CETDST';

SELECT now()::date;
SELECT now()::time;
SELECT now()::timetz;
SELECT now()::abstime;		2003-12-02 02:51:20-08

Postgres built-in date and time calculation functions

SELECT now()::date + INTERVAL '1 DAY';
SELECT now()::date + INTERVAL '3 DAYS';
SELECT now()::time + INTERVAL '9 HOURS';

Geek Problem:
is of type abstime but expression is of type time without time zone

Time Zones

Postgres obtains time zone support from the underlying operating system. All dates and times are stored internally in Universal Coordinated Time (UTC), alternately known as Greenwich Mean Time (GMT). Times are converted to local time on the database server before being sent to the client frontend, hence by default are in the server time zone.

There are several ways to affect the time zone behavior:

  • The TZ environment variable used by the backend directly on postmaster startup as the default time zone.

  • The PGTZ environment variable set at the client used by libpq to send time zone information to the backend upon connection.

  • The SQL command SET TIME ZONE sets the time zone for the session.

Know-How home | Must Read | What's new? | iC Site Map
link search
©1998-2004 infoCopter