sql - redshift to_timestamp() without millisecond -


how convert string 2017-06-20t09:52:33+0000 timestamp 2017-06-20 09:52:33. tried still got last +00:

select to_timestamp(substring('2017-06-20t09:52:33+0000',1,19), 'yyyy-mm-dd hh24:mi:ss')    >> 2017-06-20 09:52:33+00 

try:

select left(to_timestamp(substring('2017-06-20t09:52:33+0000',1,19), 'yyyy-mm-dd hh24:mi:ss'),19);  >> 2017-06-20 09:52:33 

this'll work sure. let me know if still face issues.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

java - How to implement an entity bound odata action in olingo v4.3 -