Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert from UNIX Time to a timezone

Recently, I have to work with a system that stores time in UNIX format. In UNIX systems time is represented as the number of seconds that have elapsed since January 1st, 1970 00:00:00 (UTC).   After doing some research I found out how to translate this numbers into timestamp:

Timestamp = UnixTime / 86400 + 25569

For instance, If you want to convert unix time 1405688400 into timestamp, you have to use the following expression:

test.PNG.png

The resulting timestamp is in UTC. In case that you need to convert this time to another timezone ConvertToLocalTime can be used. For instance if you want to convert to PST time:


foto.png

Hope this helps.

Regards,

Karla.





3 Replies
JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

Hola Karla:

Si haces la conversión durante el script evitarás recalcular todas las TS en cada click

Saludos

Joaquín

Anonymous
Not applicable
Author

Hola Joaquinlr,

Gracias por la sugerencia, y si en efecto lo hicimos hace un par de dias. Tuvimos que extraer la data de una central telefonica para analizar el trafico de llamadas, e hicimos la conversion a nivel de scripting y tener disponible el valor de timestamp ya calculado en la visualizacion.

Saludos Cordiales,

-- Karla

JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

Perfecto Karla.

Como creaste un blog no sé si puedes marcar la respuesta como útil y correcta, Siempre ayuda a los compañeros a filtrar sus búsquedas

Saludos

Joaquín