pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedStrange behavior with timestamps
2+ messages / 2 participants
[nested] [flat]
* Strange behavior with timestamps
@ 2001-03-08 20:19 Marc Wrubleski <mlwruble@sorexsoftware.com>
2001-03-12 22:53 ` Re: Strange behavior with timestamps Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Marc Wrubleski @ 2001-03-08 20:19 UTC (permalink / raw)
To: pgsql-admin
Hi all,
I am witnessing something strange with my timestamps here and I am
desperately hoping someone can explain or assist.
If I set a time using unix timestamp, it is recalled as a different time
a week different!
The following example is for illustration purposes:
pulver=# select version();
version
-------------------------------------------------------------
PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc 2.96
pulver=# update connections set starttime = timestamp 'epoch' + reltime
'984685319';
UPDATE 1
pulver=# select date_part('epoch', starttime) from connections;
date_part
-----------
985290119
(1 row)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Strange behavior with timestamps
2001-03-08 20:19 Strange behavior with timestamps Marc Wrubleski <mlwruble@sorexsoftware.com>
@ 2001-03-12 22:53 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2001-03-12 22:53 UTC (permalink / raw)
To: Marc Wrubleski <mlwruble@sorexsoftware.com>; +Cc: pgsql-admin
Marc Wrubleski <mlwruble@sorexsoftware.com> writes:
> pulver=# update connections set starttime = timestamp 'epoch' + reltime
> '984685319';
That calculation does not do what you seem to think it does. (Hint:
reltime is not simply a number of seconds.)
Try just timestamp(984685319) instead.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-03-12 22:53 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-03-08 20:19 Strange behavior with timestamps Marc Wrubleski <mlwruble@sorexsoftware.com>
2001-03-12 22:53 ` Tom Lane <tgl@sss.pgh.pa.us>
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