Paul Taylor
Paul Taylor

Reputation: 13110

How do I output the time in postgres sql

I know about \echo but that just seems to output the rest of the line literally, i want something like \echo date

Upvotes: 0

Views: 991

Answers (3)

developer
developer

Reputation: 728

And if you want both the date and the time (almost always) use:

select now();

Upvotes: 0

Alexi Theodore
Alexi Theodore

Reputation: 1677

The only example in pg docs is actually the answer to this...

\echo date

Upvotes: 0

Paul Taylor
Paul Taylor

Reputation: 13110

So based on the comment

select current_time

works for me.

Upvotes: 1

Related Questions