发现在PHP中解析SDK 2日期间的数据
问题描述:
$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))
]
);
我都试过,但没有受到影响......你能帮助我在此发现在PHP中解析SDK 2日期间的数据
答
在我的情况,我明确地转换日期从我的代码解析日期。然后我使用下面的ParseQuery。我希望这会帮助某人。我花了4个小时解决这个问题
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);