# API - Filter by date

**URL:** <https://discourse.getcockpit.com/t/api-filter-by-date/2001>\
**Category:** Support\
**Created:** [July 14, 2021, 3:21pm UTC](https://discourse.getcockpit.com/t/api-filter-by-date/2001 "2021-07-14T15:21:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![abernh](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/abernh/32/859_2.png) [@abernh](https://discourse.getcockpit.com/u/abernh)\
**Post date:** [July 15, 2021, 9:34am UTC](https://discourse.getcockpit.com/t/api-filter-by-date/2001/2 "2021-07-15T09:34:11Z")

</div>

Afaik `_created` and `_modified` are saved as unix timestamps (in seconds).  
Did you try to use a `$lt` / `$gt` filter to filter for items with  
`end-of-day-as-unix-timestamp < value < begin-of-day-as-unix-timestamp` ?

See also [Filtering by date using PHP](https://discourse.getcockpit.com/t/filtering-by-date-using-php/1602)

---

_[View the full topic](https://discourse.getcockpit.com/t/api-filter-by-date/2001)._
