Re: [GENERAL] date & time

From: James Thompson <jamest(at)math(dot)ksu(dot)edu>
To: hoelc <hoelc(at)pd(dot)jaring(dot)my>
Cc: pgsql-admin(at)hub(dot)org, pgsql-admin(at)postgreSQL(dot)org, pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] date & time
Date: 1999-03-06 20:03:03
Message-ID: Pine.GSO.4.05.9903061400440.12387-100000@noether.math.ksu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

On Sun, 7 Mar 1999, hoelc wrote:

> Hello,
> Can some one please tell me how to set the date&time in the PostgreSQL
> system?
> I try to use date('now') and time('now') to keep tract of the data and
> time when the data is inserted or updated. When I use sql " insert into
> table (data1, date_chg, time_chg) values ('abc',date('now'),time('now'))
> " to insert the date and time data, the data successfully inserted but
> when I retrive the data, it shows that the date and time is always "
> 01-01-2000 " and " 08:00:00 " , now is of couse not year 2000 and the
> time is also not 8 o'clock. Why? How should I correct this?
> I am using PostgreSQL in Linux system, and the date & time for Linux
> system are correct.
>

I use date(now()) and it seems to work ok for me. Until I added the ()
after now it was always some fixed date just like you have. Never tried
it with time.

->->->->->->->->->->->->->->->->->->---<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<
James Thompson 138 Cardwell Hall Manhattan, Ks 66506 785-532-0561
Kansas State University Department of Mathematics
->->->->->->->->->->->->->->->->->->---<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<-<

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Todd Graham Lewis 1999-03-06 21:27:15 RE: [HACKERS] RE: [GENERAL] Transaction logging
Previous Message Kevin Heflin 1999-03-06 17:25:48 Re: [GENERAL] date & time

Browse pgsql-interfaces by date

  From Date Subject
Next Message Anatoly K. Lasareff 1999-03-07 09:56:05 Re: [ADMIN] date & time
Previous Message Stan Brown 1999-03-06 18:43:56 How to use formsdemo.sql