Re: timestamp

From: David Eduardo Gomez Noguera <davidgn(at)servidor(dot)unam(dot)mx>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: davidgn(at)servidor(dot)unam(dot)mx
Subject: Re: timestamp
Date: 2001-11-12 15:45:28
Message-ID: 20011112094528.2e355922.davidgn@servidor.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


long stamp=System.currentTimeMillis(); // Or whatever you use to get yout long.
Timestamp ts = new Timestamp(stamp);

seems like c++ or some other oolanguage code. hide most main things.

i was wondering if the table should have a date field as the field for timestamp, or an integer field
ie create table p (... timestamp date ...)
or create table p (... timestamp integer ...)

or if pgsql interface libraries had a structure (plain c programming here) or a veriable defined for dates from files (creatin time, modification time, etc...), since it might vary from filesystem to filesystem, or if i did a store from the time of the file into the database as an integer into an integer, or turn the time from the file into a string, and then store it in the database as a date. always with a query, of course.
Hope that helps.

Antonio

David Eduardo Gomez Noguera wrote:

> hello.
> i am doing some database, that will have a field indicating the time when that field was last modified, and want to compare it to a file's modification time.
> what is the best way to do it? directly store the timestamp of the file as an integer? or turn the file timestamp into date, and then store it as date in the db? or is there a speciall field for that?
>
--
ICQ: 15605359 Bicho
=^..^=
First, they ignore you. Then they laugh at you. Then they fight you. Then you win. Mahatma Gandhi.
........Por que no pensaran los hombres como los animales? Pink Panther........
-------------------------------気検体の一致------------------------------------
暑さ寒さも彼岸まで。
アン アン アン とっても大好き

In response to

  • timestamp at 2001-11-12 13:10:45 from David Eduardo Gomez Noguera

Browse pgsql-hackers by date

  From Date Subject
Next Message Jorge Sarmiento 2001-11-12 16:09:01 Re: psql -f backup.out || file too big - SOLVED
Previous Message Tom Lane 2001-11-12 15:23:42 Re: Open items