How to convert this Date format :
2017-12-20 09:26:03
To:
2017-10-05T09:31:00.000Z
I am getting date values from mysql db in the format
2017-10-05T09:31:00.000Z
and in my PHP block I am getting $this->date->gmtDate() in the format
2017-12-20 09:26:03
. In my query I have to fetch values from the database column greater than the current datetime. If some one can sort out how to convert the date format I would be able to fetch the values from the date column.
My Query is :
$date = $this->date->gmtDate();
$collection = $this->collectionFactory->create()
->addFieldToFilter('is_active', 1)
->addFieldToFilter('_end_date', array('gteq' => $date))