Formatting time as a unix timestamp

0

We are able to enter records into tables using any time unit. But when querying the table, I can only seem to be able to return it as what I can assume is the ISO format. IE: 2021-03-18 04:00:00.055000000

Is there any way to get a query result with a unix like timestamp instead?

DrBomb
feita há 3 anos753 visualizações
2 Respostas
0
Resposta aceita

You can use the to_unixtime() function on the timestamp to convert to unix time e.g. select to_unixtime('2021-03-18 04:00:00.055000000')

AWS
respondido há 3 anos
0

Thank you, this worked. Any reason why this function is not documented? I don't see it anywhere on the AWS Timestream docs.

DrBomb
respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas