# Best Way to Convert Date Strings to Timestamps in Dynatrace DQL?

**URL:** <https://community.dynatrace.com/t/best-way-to-convert-date-strings-to-timestamps-in-dynatrace-dql/54148>\
**Category:** DQL\
**Tags:** dql, data-engineering, logs\
**Created:** [November 20, 2025, 12:50am UTC](https://community.dynatrace.com/t/best-way-to-convert-date-strings-to-timestamps-in-dynatrace-dql/54148 "2025-11-20T00:50:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akhil-Jayendran](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/akhil-jayendran/32/153_2.png) [@Akhil-Jayendran](https://community.dynatrace.com/u/Akhil-Jayendran)\
**Post date:** [November 20, 2025, 12:50am UTC](https://community.dynatrace.com/t/best-way-to-convert-date-strings-to-timestamps-in-dynatrace-dql/54148/1 "2025-11-20T00:50:14Z")

</div>

Hello Team ,

I have a field in my logs that contains the date and time, but the field type is a string. Is there a way to convert this field into a timestamp? I tried the totimestamp function, but it isn’t working. The field is in the format MM/DD/YYYY HH:MM:SS.

 ![Screenshot 2025-11-19 at 6.46.50 PM.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/b/6b0c11f8bce3e61c03d48cdd3b210db3e2b9945f.png)

Please let me know if anyone has a solution for this?

Regards,

Akhil Jayendran

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [November 20, 2025, 7:07am UTC](https://community.dynatrace.com/t/best-way-to-convert-date-strings-to-timestamps-in-dynatrace-dql/54148/2 "2025-11-20T07:07:40Z")

</div>

You need to use the [parse](https://docs.dynatrace.com/docs/shortlink/extraction-and-parsing-commands#parse) command and DPL with [timestamp](https://docs.dynatrace.com/docs/shortlink/dpl-time-date#timestamp-time)&nbsp;matcher:

```markup
data record(str="11/30/2025 08:02:20")
| parse str, """TIMESTAMP("MM/dd/yyyy HH:mm:ss"):ts"""

```
