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)

Need Your Help

Programmatic equivalent of default(Type)

c# reflection default

I'm using reflection to loop through a Type's properties and set certain types to their default. Now, I could do a switch on the type and set the default(Type) explicitly, but I'd rather do it in ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.