cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API call with exact timestamps

Litodrako1992
Frequent Guest

Hello!

 

When I make an API call to get metrics information I always use the "from" parameter and add a "now-24h", for example.

 

I'm trying to see, but I can't, what I can do to put absolute times, for example: 2022-02-23 10:00 - 2022-02-22: 10:00

 

If you could tell me where to find the documentation I would appreciate it, because I have found something similar, but in my case it doesn't apply.

 

Greetings!

1 REPLY 1

mark_bley
Dynatrace Champion
Dynatrace Champion

Hi @Litodrako1992,

the following format is supported by the API for the 'from' and 'now' fields:

params = {
'from': '2022-03-20T00:00:00.000+02:00',
'now': '2022-03-31T00:00:00.000+02:00'
}

The +02:00 defines the UTC timezone, which for my case is +02:00, adjust this value to your timezone as needed, default is UTC +00:00 (basically means you could also leave that last part out)

 

You can also leave the milliseconds out, just in case you may need them.

So a simplified version of the timestamp could look like this: 2022-03-20T00:00:00

 

Best,

Mark

Featured Posts