How to Get Day Names in PostgreSQL Database: PostgreSQL Operators: to_char() date LC_TIME Table of Contents Problem Solution 1 Discussion Solution 2 Problem You want to extract the name of the day of the week from a date in PostgreSQL. Solution 1 To extract the day name from the date, you can use the to_char() function. The first argument is the date and the second is the desired output format. To extract the full day name, the format should be 'Day': SELECT to_char(date '2022-01-01', 'Day'); The result is Saturday. Discussion This is not the only format you can use to extract the day name. Here are some alternatives: 'DAY' would return an uppercase name (SATURDAY) 'day' would return a lowercase name (saturday) 'DY' would return SAT 'Dy' would return Sat 'dy' would return sat You can also extract the day name in other languages. Two adjustments are required to do this: Setting new locale for times and dates using SET lc_time; Using the 'TMDay' format to enable translation based on lc_time. Let’s look at an example. Solution 2 Let’s extract the day name in German: set lc_time = 'de_DE'; select to_char(date '2022-01-01', 'TMDay') ; The result is Samstag. Recommended courses: Common PostgreSQL Functions SQL Practice Set in PostgreSQL Recommended articles: PostgreSQL Cheat Sheet Standard SQL Functions Cheat Sheet Performing Calculations on Date- and Time-Related Values SQL Date and Time Functions in 5 Popular SQL Dialects 19 PostgreSQL Practice Exercises with Detailed Solutions Best Books for Learning PostgreSQL PostgreSQL Date Functions See also: How to Convert a String to a Date in PostgreSQL How to Extract the Week Number from a Date in PostgreSQL How to Get the Day of the Year from a Date in PostgreSQL Subscribe to our newsletter Join our monthly newsletter to be notified about the latest posts. Email address How Do You Write a SELECT Statement in SQL? What Is a Foreign Key in SQL? Enumerate and Explain All the Basic Elements of an SQL Query