X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1C559D1B18A for ; Tue, 3 Aug 2004 09:39:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76693-02 for ; Tue, 3 Aug 2004 12:39:35 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id CFF9AD1B1CD for ; Tue, 3 Aug 2004 09:39:31 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id i73BoiQr007922; Tue, 3 Aug 2004 14:50:44 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id i73BohWw007918; Tue, 3 Aug 2004 14:50:43 +0300 Date: Tue, 3 Aug 2004 14:50:43 +0300 (EEST) From: Achilleus Mantzios To: Michael Glaesemann Cc: "Pedro B." , Subject: Re: Datetime In-Reply-To: <9F40F448-E540-11D8-8966-000A95C88220@myrealbox.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/24 X-Sequence-Number: 18521 O kyrios Michael Glaesemann egrapse stis Aug 3, 2004 : > > On Aug 3, 2004, at 7:23 PM, Achilleus Mantzios wrote: > > > now() returns the current UNIX (your running UNIX right?) timestamp > > which > > in turn is > > measured in seconds,miliseconds since the epoch. > > i.e. 1970-01-01 00:00:00 > > I believe this is incorrect. I believe PostgreSQL uses its own Do you suggest postgresql has any other means of getting time except the time(2) syscall?? > timestamp datatype internally (which is, indeed, not as text in an > easy-to-read form). On my machine (running cvs-head), > > test=# select now(); > now > ------------------------------- > 2004-08-03 20:27:18.822646+09 > (1 row) > > which is definitely not seconds.milliseconds since epoch. You can use > extract to get seconds.milliseconds from epoch, but I don't think this > is how it's stored internally. > > test=# select extract(epoch from now()); > date_part > ----------------- > 1091532506.3222 > (1 row) > > Just some additional trivia, current_timestamp is an SQL-spec compliant > alias for now(), and might be a better choice if one is concerned with > compatibility. > > Michael Glaesemann > grzm myrealbox com > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > -- -Achilleus