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
preguntada hace 3 años751 visualizaciones
2 Respuestas
0
Respuesta aceptada

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 hace 3 años
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 hace 3 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas