What is the equivalent of the SQLite datetime function in PostgreSQL?

The question is pretty self-explanatory. I'm looking for a PostgreSQL equivalent to the SQLite datetime function.

Answers


postgres=# select to_char(now(),'YYYY-mm-dd HH:MM:ss');
       to_char
---------------------
 2008-09-24 02:09:20
(1 row)

postgres=# select to_char(now(),'YYYY-mm-dd HH24:MM:ss');
       to_char
---------------------
 2008-09-24 14:09:20
(1 row)

I think this is what your're searching for:

timestamp [ (p) ] [ without time zone ] or timestamp [ (p) ] with time zone

otherwise have a look @ http://www.postgresql.org/docs/8.1/interactive/datatype-datetime.html


OK, thanks for the answers, they helped point me in the right direction. What I actually was looking for was to_timestamp.


Need Your Help

Not able to click on element with unselectable='on' in chrome using webdriver

selenium webdriver

There is a drop down with an arrow on the side which opens up a sub menu. I am not able to click on the dropdown in chrome whereas its working in ie.

solution to make a open source web application in asp.net limited to be redistributed

asp.net .net security web-applications licensing

we have implemented a web application in asp.net 4.0 and customer needs us to give them the source code too so they can do the maintenance and limited improvements of application themselves ,but we...