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
asked a year ago371 views
1 Answer
1
Accepted Answer

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
EXPERT
Greg_B
answered a year ago
  • Hi Greg, thanks a lot! worked perfectly! BR Alex

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions