$profil = Company::find()
->filterWhere(['>=', 'published_at',strtotime('16-11-2017')])
->andFilterWhere(['<=', 'published_at',strtotime('16-11-2017')])
->all();
result
null
$profil = Company::find()
->filterWhere(['>=', 'published_at',strtotime('16-11-2017')])
->andFilterWhere(['<=', 'published_at',strtotime('17-11-2017')])
->all();
result
'16-11-2017' '16-11-2017'
$profil = Company::find()
->filterWhere(['<=', 'published_at',strtotime('17-11-2017')])
->all();
result
'16-11-2017' '16-11-2017'
$profil = Company::find()
->filterWhere(['>=', 'published_at',strtotime('16-11-2017')])
->all();
result
'16-11-2017' '16-11-2017' '17-11-2017' '17-11-2017' '17-11-2017' '17-11-2017' '17-11-2017'
in my model
public function rules(){
return [
['published_at', 'date', 'timestampAttribute' => 'published_at', 'format' => 'dd-MM-yyyy'],
['published_at', 'default', 'value' => time()],
];
}
public function getPublishedDate(){
return Yii::$app->formatter->asDate(($this->isNewRecord) ? time() : $this->published_at,'dd-MM-yyyy');
}
in my db there are only two dates.
date "17-11-2017" wont showing while use operator "<=" with the same filter date.
what i miss?