Working with timestamps and Unix Time

From: "Kirby Krueger" <kirbyk(at)idiom(dot)com>
To: "Pgsql-Novice(at)Postgresql(dot) Org" <pgsql-novice(at)postgresql(dot)org>
Subject: Working with timestamps and Unix Time
Date: 2002-10-30 02:10:50
Message-ID: LHEPILOHLNIGBPAOJMNJKEMOCBAA.kirbyk@idiom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

A quick question:

I have a field of type 'Timestamp'. I want to extract it in Unix Epoch Time
format (ie, seconds since Jan 1, 1970.) What's the syntax to do this in
Postgres?

And, similarly, when I'm done it'd be awfully convenient if I could stick
that number right back into the timestamp field. Looking at the
documentation, I bet it'll understand it, but does anyone know if there's
any trick to doing this?

Thanks for any help!

-- Kirby

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Andrew McMillan 2002-10-30 07:00:12 Re: Working with timestamps and Unix Time
Previous Message Nikh Nath 2002-10-30 01:39:00 Re: Unable to use COPY..FROM with NULL numeric fields