You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by dbutkovic <dr...@gmail.com> on 2020/04/17 07:06:12 UTC

EPOCH to timestamp

Hi,
is there a function with which timestamp can be obtained from epoch.

example

select EXTRACT (EPOCH from CURRENT_TIMESTAMP(3));
+------------------------------------------+
| EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(3)) |
+------------------------------------------+
| 1587113983.052                           |
+------------------------------------------+

How to convert from epoch seconds to timestamp ?

Best regards
Dren



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: EPOCH to timestamp

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

I came across this solution:
select dateadd('s', 1587750989, '1970-01-01 00:00:00 UTC');
https://stackoverflow.com/questions/31804762/how-to-convert-timestamp-to-seconds-in-h2

Regards,
-- 
Ilya Kasnacheev


пт, 17 апр. 2020 г. в 10:06, dbutkovic <dr...@gmail.com>:

> Hi,
> is there a function with which timestamp can be obtained from epoch.
>
> example
>
> select EXTRACT (EPOCH from CURRENT_TIMESTAMP(3));
> +------------------------------------------+
> | EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(3)) |
> +------------------------------------------+
> | 1587113983.052                           |
> +------------------------------------------+
>
> How to convert from epoch seconds to timestamp ?
>
> Best regards
> Dren
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>