AWS IoT Core parser time with time zone

0

Hi everyone. Someone can help me? I try to convert using the parse time function (parse_time(String, Long[, String])) in AWS Iot Core Rule, but it always results as UTC GMT (00:00), even though my AWS Region is Sao Paulo (sa-east-1). How can I get local time using parse_time function as UTC-0300?

my Sql command used in Iot core rule is: ... parse_time("yyyy-MM-dd'T'HH:mm:ssZZ", timestamp()) as timeStamp, ...

argollo
preguntada hace un año385 visualizaciones
1 Respuesta
1
Respuesta aceptada

Hi argollo. You need to pass the timezone as a third argument. That argument should be Joda-time: https://joda-time.sourceforge.net/timezones.html. Otherwise it defaults to UTC.

So parse_time("yyyy-MM-dd'T'HH:mm:ssZZ", timestamp(), 'America/Sao_Paulo').

profile pictureAWS
EXPERTO
Greg_B
respondido hace un año
  • Hi Greg, thanks a lot! worked perfectly! BR Alex

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