Search
 
SCRIPT & CODE EXAMPLE
 

SQL

timestamp postgres

INSERT INTO timestamp_demo (ts, tstz)
VALUES('2016-06-22 19:10:25-07','2016-06-22 19:10:25-07');
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp(0) postgresql

(now())::timestamp(0))
Comment

timestamp postgres

CREATE TABLE timestamp_demo (
    ts TIMESTAMP, 
    tstz TIMESTAMPTZ
);
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

ts          |          tstz
---------------------+------------------------
 2016-06-22 19:10:25 | 2016-06-22 19:10:25-07
(1 row)
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

SET timezone = 'America/Los_Angeles';
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

TimeZone
---------------------
 America/Los_Angeles
(1 row)
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

SHOW TIMEZONE;
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

SELECT 
   ts, tstz
FROM 
   timestamp_demo;
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

SET timezone = 'America/New_York';
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

SELECT
	ts,
	tstz
FROM
	timestamp_demo;
Code language: SQL (Structured Query Language) (sql)
Comment

timestamp postgres

ts          |          tstz
---------------------+------------------------
 2016-06-22 19:10:25 | 2016-06-22 22:10:25-04
(1 row)
Code language: SQL (Structured Query Language) (sql)
Comment

PREVIOUS NEXT
Code Example
Sql :: Kill session in SQL Developer 
Sql :: normalization in sql 
Sql :: delete all from mysql table 
Sql :: mamp mysql password 
Sql :: equi joins in oracle 
Sql :: get last inserted primary key 
Sql :: sql server synonym 
Sql :: postgresql fastapi sqlmodel example 
Sql :: disable database droping sql 
Sql :: data types in sql 
Sql :: add role to group postgres 
Sql :: sql ignore 
Sql :: fatal error uncaught mysqli_sql_exception 
Sql :: postgres enumerated type 
Sql :: mysql curdate between two dates 
Sql :: mysql ddl 
Sql :: sql except query 
Sql :: SQL Add Multiple Columns in a Table 
Sql :: SELECT SQL LIKE 
Sql :: mysql create trigger 
Sql :: primary key auto increment in postgresql 
Sql :: in sqlalchemy 
Sql :: create-toys-table-with-toy_name-column 
Sql :: mysql isshow 
Sql :: how to list all values of a column that start with a letter in sql 
Sql :: sql update from two different database 
Sql :: leftjoin in sql 
Sql :: db2 foreign keys 
Sql :: product of a column in mysql 
Sql :: Original Query 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =