【发布时间】:2015-11-30 05:17:16
【问题描述】:
我需要以 mm/dd/yyyy 格式从数据库中选择当前日期。但是 php curdate() 函数默认返回 yyyy-mm-dd 中的日期格式。我该如何解决这个问题。?
我的模型函数是:
public function get_cat($category)
{
$this->db->select('*');
if($category!='')
{
$this->db->like('Category',$category,'both');
$this->db->from('tbl_job');
$this->db->where('Expiry_date >=','DATE(CURDATE())',FALSE);
$result = $this->db->get();
}
return $result->result();
}
【问题讨论】:
-
我在我的数据库中使用 varchar 类型。
标签: php codeigniter date date-format