Re: reverse of extract epoch?

From: Gregory Seidman <gss+pg(at)cs(dot)brown(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: reverse of extract epoch?
Date: 2002-06-03 18:32:05
Message-ID: 20020603183205.GA14198@jamaica.cs.brown.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Neil Conway sez:
} On Sun, 2 Jun 2002 21:17:50 -0400
} "Gregory Seidman" <gss+pg(at)cs(dot)brown(dot)edu> wrote:
} > Now I want to create its reverse so I can get a timestamp (with tz) from an
} > epoch-based integer. Is there some simple way of doing it?
}
} Try:
}
} select "timestamp"(extract(epoch from now())::int);

Yowza! It's been there all along! I actually wanted timestamptz(), as it
turns out, but I found that easily. Thank you!

} Cheers,
}
} Neil
--Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2002-06-03 18:36:09 Automatic value truncation during update
Previous Message Joshua b. Jore 2002-06-03 18:25:57 ctid & updates