How to Get the Current Date and Time (No Time Zone) in PostgreSQL Database: PostgreSQL Operators: LOCALTIMESTAMP Table of Contents Problem Solution Discussion Problem You’d like to get the current date and time in a PostgreSQL database. You don’t need the time zone offset. Solution We’ll use the function LOCALTIMESTAMP to get the current date and time without any time zone information: SELECT LOCALTIMESTAMP; Here’s the result of the query: 2023-09-24 20:10:58.977914 Discussion The PostgreSQL function LOCALTIMESTAMP returns the current date and time (of the machine running that instance of PostgreSQL) as a timestamp value. It uses the YYYY-MM-DD hh:mm:ss.nnnnnnn format, where: YYYY is a 4-digit year. MM is a 2-digit month. DD is a 2-digit day. hh is a 2-digit hour. mm is a 2-digit minute. ss is a 2-digit second. nnnnnn are fractional seconds (from zero to 6-digit precision). This function returns the time at which the current transaction started. The difference between LOCALTIMESTAMP and CURRENT_TIMESTAMP is that the LOCALTIMESTAMP doesn’t include the time zone offset. Recommended courses: SQL Basics in PostgreSQL Common PostgreSQL Functions SQL Practice Set in PostgreSQL Recommended articles: PostgreSQL Cheat Sheet Standard SQL Functions Cheat Sheet 18 Useful Important SQL Functions to Learn ASAP Performing Calculations on Date- and Time-Related Values SQL Date and Interval Arithmetic: Employee Lateness 19 PostgreSQL Practice Exercises with Detailed Solutions Best Books for Learning PostgreSQL PostgreSQL Date Functions See also: How to Get the Current Date and Time with Time Zone Offset in PostgreSQL How to Get Current Time (No Time Zone) in PostgreSQL How to Get the Current 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