Thread: Conversion from Unix timestamp to datetime?

Conversion from Unix timestamp to datetime?

From
Tom Lane
Date:
I'd like to be able to convert between times specified in Unix timestamp
format and SQL datetime values without going through the slow and rather
error-prone process of converting to a human-readable date notation.

I see how to get a datetime value returned as a Unix timestamp:

    tgl=> select date_part('epoch', 'now'::datetime);
    date_part
    ---------
    900355156
    (1 row)

But I don't see any way to supply a value in the form "900355156"
and have it get converted to datetime.  Is there a way to do that?

BTW, it seems like the standard data type 'timestamp' ought to be
good for this, but it isn't as far as I can tell ... it hasn't got
any working conversions to/from integer either.

            regards, tom lane

How do I store graphics in my tables?

From
Dan Delaney
Date:
Hello all.
   What type of field should I use if I want to store bitmap images
in my tables? Also, since I'm making the interface to my database
completely Web-based with PHP, does anyone know of a way that I can
have the user put graphics into the table from the web page form?
   Thanks a lot.
 --Dan

-----------------------------------------------------------------------
 Daniel G. Delaney                    The Louisville Times Chorus
 Dionysos@Dionysia.org                   www.LouisvilleTimes.org
 www.Dionysia.org/~dionysos/          Dionysia Design
 ICQ Number: 8171285                     www.Dionysia.com/design/
-----------------------------------------------------------------------
                   I doubt, therefore I might be.