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
posta un anno fa386 visualizzazioni
1 Risposta
1
Risposta accettata

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
ESPERTO
Greg_B
con risposta un anno fa
  • Hi Greg, thanks a lot! worked perfectly! BR Alex

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande