I using the PHP library for parse.com and I wanna do a filter between two dates compared with CreatedAt field, I'm trying to use:
$pqry->whereGreaterThanOrEqualTo('createdAt', $pqry->dataType('date', $startdate)) ;
$pqry->whereLessThanOrEqualTo('createdAt', $pqry->dataType('date', $enddate)) ;
//$startdate = '2014/07/21 00:00:00'; $endtdate = '2014/07/21 23:59:59';
but don't work, i found this code:
public function whereBetweenOrEqualDates($key, $startDate, $endDate){
if(isset($key) && isset($startDate) && isset($endDate)){
$this->_query[$key] = array(
'$gte' => $startDate,
'$lte' => $endDate
);
}
But don't work well, some one can tell me the best way to do this filter?
Regards
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…