Skip to content

Issues with date whereBetween not work #1276

@Xiaocge

Description

@Xiaocge

my code:
$startDate = new \DateTime($startDate);
$endDate = new \DateTime($endDate);
User::whereBetween('created_at', [$startDate, $endDate ]);

Execute SQL:
User.aggregate([{"$match":{{"created_at":{"$gte":{"date":"2016-09-01 00:00:00.000000","timezone_type":3,"timezone":"Asia/Shanghai"},"$lte":{"date":"2017-09-01 00:00:00.000000","timezone_type":3,"timezone":"Asia/Shanghai"}}},{"deleted_at":null}]}},{"$group":{"aggregate":{"$sum":1},"_id":null}}],{"typeMap":{"root":"array","document":"array"}})

Please help

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions