DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

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

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

 

Regards,

Akhil Jayendran

!!! Dynatrace !!!
1 REPLY 1

Julius_Loman
DynaMight Legend
DynaMight Legend

You need to use the parse command and DPL with timestamp matcher:

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

 

Dynatrace Ambassador | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts