# Need assistance with converting timestamp from the format (2024030602500000) (yyyymmddhhmmssSS) to 2024-03-06T02:50:00Z

**URL:** <https://community.dynatrace.com/t/need-assistance-with-converting-timestamp-from-the-format-2024030602500000-yyyymmddhhmmssss-to-2024-03-06t0200z/44462>\
**Category:** Open Q&A\
**Tags:** latest-dynatrace, dynatrace-saas, oneagent\
**Created:** [March 5, 2024, 11:02pm UTC](https://community.dynatrace.com/t/need-assistance-with-converting-timestamp-from-the-format-2024030602500000-yyyymmddhhmmssss-to-2024-03-06t0200z/44462 "2024-03-05T23:02:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthik\_r](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@karthik\_r](https://community.dynatrace.com/u/karthik_r)\
**Post date:** [March 5, 2024, 11:02pm UTC](https://community.dynatrace.com/t/need-assistance-with-converting-timestamp-from-the-format-2024030602500000-yyyymmddhhmmssss-to-2024-03-06t0200z/44462/1 "2024-03-05T23:02:29Z")

</div>

Hello Team,

Can anyone please assist with conversion of the following timestamp in dynatrace log processing rules?

To convert timestamp from the format (2024030602500000) (yyyymmddhhmmssSS) to 2024-03-06T02:50:00Z (local timezone of the oneAgent server)

Thanks.

---

<div class="post-metadata">

**Author:** ![cesarsaravia](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/cesarsaravia/32/12818_2.png) [@cesarsaravia](https://community.dynatrace.com/u/cesarsaravia)\
**Post date:** [March 5, 2024, 11:17pm UTC](https://community.dynatrace.com/t/need-assistance-with-converting-timestamp-from-the-format-2024030602500000-yyyymmddhhmmssss-to-2024-03-06t0200z/44462/2 "2024-03-05T23:17:42Z")

</div>

Hi&nbsp;[@karthik\_r](https://community.dynatrace.com/user/73014)&nbsp;  
You can use the [Timestamp/Splitting patterns](https://docs.dynatrace.com/docs/shortlink/lma-timestamp-configuration#createrule) to make what you want.

If you already upgraded to Log management and analytics (GRAIL), You can use the DQL to convert the data type of your timestamp. See this example:

 ![cesarsaravia_0-1709680929151.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/ab98b8c3bf1d1b4938cbce8c9561c1d6e123df38.png)

Reference:&nbsp;[Conversion and casting functions — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/conversion-and-casting-functions#toTimestamp)

Regards,

---

<div class="post-metadata">

**Author:** ![karthik\_r](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@karthik\_r](https://community.dynatrace.com/u/karthik_r)\
**Post date:** [March 6, 2024, 11:48am UTC](https://community.dynatrace.com/t/need-assistance-with-converting-timestamp-from-the-format-2024030602500000-yyyymmddhhmmssss-to-2024-03-06t0200z/44462/3 "2024-03-06T11:48:41Z")

</div>

Thanks&nbsp;[@cesarsaravia](https://community.dynatrace.com/user/30478)&nbsp;for your response.

The timestamp value (2024030602500000) what I am trying to convert is not the Unix Epoch time, and when I try to convert the value, it gives me the following, which is not correct.

Query: data record(timestamp = 2024030602500000)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | fieldsAdd type(timestamp), toTimestamp(timestamp)

Output: toTimestamp(timestamp)

1970-01-24 15:43:50.602

Please let me know if I am doing anything wrong.

---

<div class="post-metadata">

**Author:** ![cesarsaravia](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/cesarsaravia/32/12818_2.png) [@cesarsaravia](https://community.dynatrace.com/u/cesarsaravia)\
**Post date:** [March 6, 2024, 3:22pm UTC](https://community.dynatrace.com/t/need-assistance-with-converting-timestamp-from-the-format-2024030602500000-yyyymmddhhmmssss-to-2024-03-06t0200z/44462/4 "2024-03-06T15:22:43Z")

</div>

Hi&nbsp;[@karthik\_r](https://community.dynatrace.com/user/73014)&nbsp;  
In that case you need to use the function timestamp.

```markup
data record(timestamp = 2024030602500000)
| fieldsAdd new_time= timestamp(year:2024, month:3, day:6, hour:2, minute:50, second:00)

```

![cesarsaravia_0-1709738525986.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/a/aa1dccc8e19772bf5bb4768ff16ace52434bafff.png)

Ps: I think you should use a parse function to extract those values for year, month, day, hour, minute and second from your custom timestamp value.

Reference:

- [Time functions — Dynatrace Docs](https://docs.dynatrace.com/docs/shortlink/time-functions#timestamp)
- [https://docs.dynatrace.com/docs/shortlink/string-functions#parse](https://docs.dynatrace.com/docs/shortlink/string-functions#parse)

Regards,
