You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@trafodion.apache.org by "Liu, Yuan (Yuan)" <yu...@esgyn.cn> on 2017/11/30 05:50:33 UTC

How to convert numeric to timestamp

Hi Trafodioneers,

Does Trafodion have a function which can convert numeric to timestamp?

The value 1500220712 stands for 2017-07-16 23:58:32 in Linux.
[root@bigdata157 ~]# date -d @1500220712 +"%Y-%m-%d %H:%M:%S"
2017-07-16 23:58:32

Can we convert it the timestamp in Trafodion? I saw function CONVERTTIMESTAMP <http://trafodion.incubator.apache.org/docs/sql_reference/index.html#converttimestamp_function>  in SQL manual, but it seems it does not work.

SQL>select converttimestamp(1500220712) from dual;

*** ERROR[8405] The operand of function CONVERTTIMESTAMP is out of range. [2017-11-30 13:36:11]

Best regards,
Yuan


RE: How to convert numeric to timestamp

Posted by "Liu, Yuan (Yuan)" <yu...@esgyn.cn>.
Thanks.

I just mentioned that we can use dateadd function.

SQL>select dateadd(SECOND,1500220712,timestamp '1970-01-01 00:00:00') from dual;

(EXPR)
---------------------
2017-07-16 15:58:32.0

--- 1 row(s) selected.





Best regards,
Yuan

From: Li, Ying-Shuai
Sent: Thursday, November 30, 2017 2:03 PM
To: user <us...@trafodion.incubator.apache.org>
Cc: Liu, Yuan (Yuan) <yu...@esgyn.cn>
Subject: Re: How to convert numeric to timestamp

the function converttimestamp in trafodion is convert  julian-timestamp value to timestamp and the julian-timestamp value must be in the range from 148731 63200000000 to 274927348799999999.

The value 1500220712 is a unixtiime value, and it does not supported in trafodion now.

________________________________
李英帅
易鲸捷信息技术有限公司<http://www.esgyn.cn/>
手机:18701691214
邮箱:yingshuai.li@esgyn.cn<ma...@esgyn.cn>

From: Liu, Yuan (Yuan)<ma...@esgyn.cn>
Date: 2017-11-30 13:50
To: user@trafodion.incubator.apache.org<ma...@trafodion.incubator.apache.org>
Subject: How to convert numeric to timestamp
Hi Trafodioneers,

Does Trafodion have a function which can convert numeric to timestamp?

The value 1500220712 stands for 2017-07-16 23:58:32 in Linux.
[root@bigdata157 ~]# date -d @1500220712 +"%Y-%m-%d %H:%M:%S"
2017-07-16 23:58:32

Can we convert it the timestamp in Trafodion? I saw function CONVERTTIMESTAMP <http://trafodion.incubator.apache.org/docs/sql_reference/index.html#converttimestamp_function>  in SQL manual, but it seems it does not work.

SQL>select converttimestamp(1500220712) from dual;

*** ERROR[8405] The operand of function CONVERTTIMESTAMP is out of range. [2017-11-30 13:36:11]

Best regards,
Yuan


Re: How to convert numeric to timestamp

Posted by "yingshuai.li@esgyn.cn" <yi...@esgyn.cn>.
the function converttimestamp in trafodion is convert  julian-timestamp value to timestamp and the julian-timestamp value must be in the range from 148731 63200000000 to 274927348799999999.

The value 1500220712 is a unixtiime value, and it does not supported in trafodion now.



李英帅
易鲸捷信息技术有限公司
手机:18701691214
邮箱:yingshuai.li@esgyn.cn
 
From: Liu, Yuan (Yuan)
Date: 2017-11-30 13:50
To: user@trafodion.incubator.apache.org
Subject: How to convert numeric to timestamp
Hi Trafodioneers,
 
Does Trafodion have a function which can convert numeric to timestamp?
 
The value 1500220712 stands for 2017-07-16 23:58:32 in Linux.
[root@bigdata157 ~]# date -d @1500220712 +"%Y-%m-%d %H:%M:%S"
2017-07-16 23:58:32 
 
Can we convert it the timestamp in Trafodion? I saw function CONVERTTIMESTAMP  in SQL manual, but it seems it does not work.
 
SQL>select converttimestamp(1500220712) from dual;
 
*** ERROR[8405] The operand of function CONVERTTIMESTAMP is out of range. [2017-11-30 13:36:11]
 
Best regards,
Yuan