Urgent problem on data set

Thank you. Assuming this time already represents America/Sao_Paulo time, you can parse it like so using Luxon (where $json.SaoPauloTimestamp references the incoming data):

{{ DateTime.fromFormat($json.SaoPauloTimestamp, "yyyy-MM-dd HH:mm:ss", { "zone": "America/Sao_Paulo" }) }}

Parsing UTC time works pretty much the same:

{{ DateTime.fromFormat($json.UtcTimestamp, "yyyy-MM-dd HH:mm:ss", { "zone": "UTC" }) }}

Now with this Luxon object you can easily format it just the way you want using the .toFormat() method. For the format you’d like to see, simply append .toFormat("yyyy-MM-dd") to the example expression above. In a workflow this could look like so:

Lastly, if for any reason you need to change the time zone on the fly you can do this by adding .setZone() to your expression like this:

{{
DateTime
  .fromFormat($json.UtcTimestamp, "yyyy-MM-dd HH:mm:ss", { "zone": "UTC" })
  .setZone("Asia/Tokyo")
  .toFormat("yyyy-MM-dd HH:mm:ss")
}}

These examples should all work regardless of your workflow, instance, or server time zone settings. Hope this helps when working with time stamps and time zones :slight_smile:

1 Like