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
已提問 1 年前檢視次數 385 次
1 個回答
1
已接受的答案

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
專家
Greg_B
已回答 1 年前
  • Hi Greg, thanks a lot! worked perfectly! BR Alex

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南