# Relative time using API?

**URL:** <https://community.graylog.org/t/relative-time-using-api/16457>\
**Category:** Graylog Central (peer support)\
**Created:** [July 21, 2020, 2:34pm UTC](https://community.graylog.org/t/relative-time-using-api/16457 "2020-07-21T14:34:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ach](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/ach/32/6874_2.png) [@ach](https://community.graylog.org/u/ach)\
**Post date:** [July 21, 2020, 2:34pm UTC](https://community.graylog.org/t/relative-time-using-api/16457/1 "2020-07-21T14:34:30Z")

</div>

Hello everyone. I see it’s possible to select a time range (from x hours or x days to x hours or x days) using graylog. Is it possible to do the same when communicating with the API ? so far I found that you can only select range in seconds.  
Many thanks !

---

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [July 22, 2020, 8:21am UTC](https://community.graylog.org/t/relative-time-using-api/16457/2 "2020-07-22T08:21:53Z")

</div>

he @ach

you would need to present the range you want to query in seconds to the API - that is what the UI does.

---

<div class="post-metadata">

**Author:** ![ach](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/ach/32/6874_2.png) [@ach](https://community.graylog.org/u/ach)\
**Post date:** [July 23, 2020, 11:43am UTC](https://community.graylog.org/t/relative-time-using-api/16457/4 "2020-07-23T11:43:57Z")

</div>

had a few confusions about relative/absolute. turned out i need to run the search in absolute mood to get what I want. thanks 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [August 6, 2020, 11:43am UTC](https://community.graylog.org/t/relative-time-using-api/16457/5 "2020-08-06T11:43:59Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
