Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgresql get date now

If you want get the current date and time without timezone, you can cast it explicitly as follows:

SELECT NOW()::timestamp;
            now
----------------------------
 2017-03-17 18:37:29.229991
(1 row)
Code language: SQL (Structured Query Language) (sql)
Comment

postgres datetime now

/*
The NOW() function returns the current date and time.
The return type of the NOW() function is the timestamp with time zone.
See the following example:*/

SELECT NOW();
/*-------------------------------*/
2017-03-18 08:21:36.175627+07
/*
Note that the NOW() function returns current date and time based on
the database server’s time zone setting.*/
Comment

postgresql get today

SELECT CURRENT_DATE;
Comment

postgresql get date now

SELECT NOW();
              now
-------------------------------
 2017-03-18 08:21:36.175627+07
Comment

PREVIOUS NEXT
Code Example
Sql :: mssql check if date is greater than today 
Sql :: mysql select default if null 
Sql :: mysql check date range 
Sql :: sql update statement 
Sql :: oracle temporary table 
Sql :: oracle locked objects 
Sql :: sql change date format 
Sql :: sql email Regex 
Sql :: sqlalchemy update row 
Sql :: sql if empty then 
Sql :: mysql permissions 
Sql :: sql server date format yyyy-MM-ddThh:mm:ss 
Sql :: alter column set not null to null postgres 
Sql :: show query code after create table in sql 
Sql :: sql select count distinct 
Sql :: enter mysql command line 
Sql :: sql character index 
Sql :: SQL Less Than or Equal to Operator 
Sql :: installing mysql on centos 7 
Sql :: postgres update single column 
Sql :: mysql ilike 
Sql :: user_dependencies 
Sql :: mysql count characters in string 
Sql :: is numeric in sql 
Sql :: alter or change postgresql sequence counter 
Sql :: mysql loop 
Sql :: mysql add to value 
Sql :: t-sql random number for each row 
Sql :: Using GROUP BY in MySQL Join Table 
Sql :: SQL LIMIT With OFFSET Clause 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =