RisingHerc
RisingHerc

Reputation: 764

postgresql - is there an alternative to datename() function in postgresql?

I am finding alternatives to various functions of SQL Server in PostgreSQL.

Is there an alternative to the following SQL Server code in PostgreSQL?

SELECT DATENAME(WEEKDAY,CURRENT_TIMESTAMP)

Note: The above query returns the "weekday-name" of the current day

Upvotes: 1

Views: 7935

Answers (1)

Alex
Alex

Reputation: 14628

You can check the official documentation for date formats https://www.postgresql.org/docs/9.5/static/functions-formatting.html

Example usage:

SELECT to_char(CURRENT_TIMESTAMP, 'Day')

Upvotes: 4

Related Questions