# Localized time in workflows?

**URL:** <https://community.dynatrace.com/t/localized-time-in-workflows/43352>\
**Category:** DQL\
**Tags:** dql, workflows\
**Created:** [December 22, 2023, 1:58pm UTC](https://community.dynatrace.com/t/localized-time-in-workflows/43352 "2023-12-22T13:58:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![calfano](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/calfano/32/35558_2.png) [@calfano](https://community.dynatrace.com/u/calfano)\
**Post date:** [December 22, 2023, 1:58pm UTC](https://community.dynatrace.com/t/localized-time-in-workflows/43352/1 "2023-12-22T13:58:33Z")

</div>

I’m writing a DQL Block in workflows and I’ve noticed the times comes back in UTC time. Is there an easy way to localize DQL executions within workflows?

Thank you!

---

<div class="post-metadata">

**Author:** ![MichalOlszewski](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@MichalOlszewski](https://community.dynatrace.com/u/MichalOlszewski)\
**Post date:** [April 12, 2024, 7:00am UTC](https://community.dynatrace.com/t/localized-time-in-workflows/43352/2 "2024-04-12T07:00:30Z")

</div>

Hi&nbsp;[@calfano](https://community.dynatrace.com/user/58627)&nbsp;,

Seems like thing that DT didn’t take into account Timezones in automation.  
This is good example for RFE, but for now You can do workaround by conversion to timestamp and adding required Timezone change and converting back to date.

```markup
fetch logs
| fields time = toTimestamp(now()) | limit 1
| fields time_local = timestampFromUnixSeconds(unixSecondsFromTimestamp(time) + 7200)

```

Bests  
Michal

---

<div class="post-metadata">

**Author:** ![El\_Stevo](https://avatars.discourse-cdn.com/v4/letter/e/ee7513/32.png) [@El\_Stevo](https://community.dynatrace.com/u/El_Stevo)\
**Post date:** [April 12, 2025, 4:06pm UTC](https://community.dynatrace.com/t/localized-time-in-workflows/43352/3 "2025-04-12T16:06:10Z")

</div>

| fieldsAdd localisedDateTime = toTimestamp(formatTimestamp(Now(), timezone:“ **Europe/London** ”))

List of locales here…

> **[List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)**
>
> This is a list of time zones from release 2026e of the tz database. Offsets of Standard Time (SDT) and Daylight Saving Time (DST) from UTC are noted in hours and minutes. For zones in which Daylight Saving is not observed, the DST offset shown in this table is a simple duplication of the SDT offset.

---

<div class="post-metadata">

**Author:** ![Florian\_1](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@Florian\_1](https://community.dynatrace.com/u/Florian_1)\
**Post date:** [March 31, 2026, 2:15pm UTC](https://community.dynatrace.com/t/localized-time-in-workflows/43352/4 "2026-03-31T14:15:43Z")

</div>

Hello,

I have the same issue using a workflow to trigger a Guardian (SRG).

As you can see my setup was set to use the timeframe ‘today’ (attachement **SRG\_timeframe.jpg** ).

But the result was always starting from 2:00am instead of 12:00am (attachement **SRG\_results.jpg** ).

\> I could not found a workaround using the native Workflow SRG task.

\> I had to add a pre-task using DQL to calculate the correct start time, here is the query (using my timezone) :

```markup
data 
record(
  start = toTimestamp(formatTimestamp(bin(now(), 24h) - (toTimestamp(formatTimestamp(bin(now(), 24h), timezone:"Europe/Paris")) - toTimestamp(formatTimestamp(bin(now(), 24h), timezone:"UTC"))), timezone:"UTC")), 
  end = toTimestamp(formatTimestamp(Now(), timezone:"Europe/Paris"))
  )

```

The start time is calculate with the substraction of the time difference between the 2 timezones.

I use that because we have to handle summer/winter time which cannot be handled by a static value given in the previous solution.

The endtime is not impacted.

Now the result is correct (attachement **SRG\_results\_with\_workaround.jpg** ).

I believe this should be corrected because

- The timezone is specified (but hardcoded) in the timeframe selection of your my SRG task
- It requires an extra (useless) step, this step is billed by Dynatrace

Hope this help future workflow users.

Florian

 ![SRG_timeframe.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/f/ff7f1a78f3f69164e40299ddeabd99ed03a711e0.jpeg)  
 ![SRG_results.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/0/6/069d8eb5062496e2a769b68f1b9e5bfb550eb8aa.jpeg)

---

<div class="post-metadata">

**Author:** ![Florian\_1](https://avatars.discourse-cdn.com/v4/letter/f/e9bcb4/32.png) [@Florian\_1](https://community.dynatrace.com/u/Florian_1)\
**Post date:** [March 31, 2026, 2:16pm UTC](https://community.dynatrace.com/t/localized-time-in-workflows/43352/5 "2026-03-31T14:16:08Z")

</div>

The missing attachment 😉

 ![SRG_results_with_workaround.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/c/ce650b6fbc77c97a7f879da9a0fd62f670a7ec46.jpeg)
