How to get entries between a time I'm using Craft 3 and I would like to do the following thing:

There is a start date and an end date filed in entry, is it possible to get entries that are between these two dates in PHP?

Thank you!
Entry::find()-&gt;startDate('&gt;='. $someTime).endTime('&lt;='.$someOtherTime).all();


Those variables can be timestamps, DateTimes or a correctly formated time string.

Here are some variants of these filters

Entry::find()
    -&gt;variantOne('&lt;=' .  Db::prepareDateForDb(new \DateTime())) &lt;-- DateTime object
    -&gt;variantTwo('&lt;=' . time())  &lt;-- as timestamp
    -&gt;variantThree('&lt;=' . (new \DateTime())-&gt;format('U')) &lt;-- timestamp as well
    -&gt;variant(['and', '&lt;=' . time() , '&gt;=' . time() - 3600]) &lt;-- entries within the last hour
    -&gt;validString(['or', '&gt;=' . (new DateTime())-&gt;format('Y-m-d H:i:s'), '&lt;= ' . time()])