I have a query with timestamps stored as unix times (with milliseconds) and UTC query parameters
My SQL query would be like
select *
from my_table
where parameter1 = 'Goofy'
and DATE(FROM_UNIXTIME(time)) >= '2020-05-13 00:00:00.000 0000' --startdate
and DATE(FROM_UNIXTIME(time)) <= '2020-05-15 00:00:00.000 0000' --enddate
and TIME(FROM_UNIXTIME(time)) >= '01-01-1970 12:22:00.000 0000' --starttime
and TIME(FROM_UNIXTIME(time)) <= '01-01-1970 19:33:00.000 0000' --endtime
In Mongo (php API) my query would look like
$query = [
'$and' => [
['parameter1' => 'Goofy']
,['time' => [$gte => <conversion to unixtime for date '2020-05-13 00:00:00.000 0000' >]]
,['time' => [$lte => <conversion to unixtime for date '2020-05-15 00:00:00.000 0000' >]]
,['time' => [$gte => <conversion to unixtime for time '01-01-1970 12:22:00.000 0000' >]]
,['time' => [$lte => <conversion to unixtime for time '01-01-1970 19:33:00.000 0000' >]]
]
];
$cursor = (new MongoDB\Client())->selectCollection('myDb', 'myTable')->find($query,[]);