This code returns the lists of scheduled posts(name, datetime).
$criteria = new CDbCriteria;
$criteria->select='name, datetime';
$criteria->condition='datetime>:datetime';
$criteria->params=array(':datetime'=>date('Y-m-d H:i:s'));
$criteria->order='DATE_FORMAT(datetime, "%d/%m/%Y") ASC';
$models = Posts::model()->findAll($criteria);
I would like to GROUP posts with same date d/m/Y and then only represent the H/i/s for each, its possible?
Like:
Array
(
[2000/10/10] => Array
(
[1] => Array
(
[name] = Post 1
[time] = 12:10
)
[2] => Array
(
[name] = Post 2
[time] = 16:20
)
[3] => Array
(
[name] = Post 3
[time] = 20:30
)
)
[2000/10/11] => Array
(
[6] => Array
(
[name] = Post 6
[time] = 10:00
)
)
)
for getting time you should select
for getting the o/p as desired use php logic