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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ