Yii Framework Forum: Problem Comparing With Date Format - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem Comparing With Date Format Problem comparing with date format Rate Topic: -----

#1 User is offline   ferminako 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 64
  • Joined: 27-February 13

Posted 06 March 2013 - 04:06 AM

Hi veryone , I show the dates on my gridviews like d-m-y and when I'm gonna use the search, it doesn't work obviously because when yii compare one date is formated like Y-m-d(model) and in the gridView is like d-m-Y so I tried to fix it changing on the model the compare instruction in function search like :

//instead of this:
$criteria->compare('date1',$this->date1,true);
//I used this.
$criteria->compare('date("d-m-Y",strtotime(date1))',$this->date1,true);

But this doen't work, can anyone help me??

Thanks!
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users