[英]find data between to 2 dates in parse sdk in php
$query = new ParseQuery("ScannedDetails");
$query->greaterThanOrEqualTo(
"createdAt",
[
"__type" => "Date",
"iso" => date('Y-m-d\TH:i:s', strtotime($startDate))
]
);
$query->lessThanOrEqualTo(
"createdAt",
[
"__type" => "Date",
"iso" => date('Y-m-d\TH:i:s', strtotime($endDate))
]
);
i have tried this but not affected ...can you help me on this 我已经尝试过了但是没有受到影响...你能帮我吗
In my case, i explicitly converted the date from my code to parse date. 就我而言,我将日期从代码中明确转换为解析日期。 Then i used ParseQuery as below.
然后我使用了如下的ParseQuery。 I hope this will help someone.
我希望这会对某人有所帮助。 It took me 4 hours to solve this problem
我花了四个小时解决了这个问题
public function convert_datetime_to_timezone($date)
{
$fromdate = str_replace('+00:00', '.000Z', gmdate('c', strtotime("$date 00:00:00 ")));
return $fromdate;
}
$query = new ParseQuery("visitation");
$query->lessThan("createdAt", $fromdate);
$obj = $query->find();
var_dump($obj);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.