Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->db->select("DATE_FORMAT(auto.fecha_reserva, '%d-%m-%Y') as fecha", FALSE);
- $this->db->from('auto');
- $datos=$this->db->get();
- return $datos->result();
- $.each(obj.resultado, function (ind, elem) {
- alert(typeof(elem.fecha));//retorna un String
- //necesito que elem.fecha sea un date.
- //lo ideal seria formatearla sin uso de plugins
- });
- $this->db->select("CONVERT(datetime, auto.fecha_reserva, 103) as fecha");
- $this->db->from('auto');
- $datos=$this->db->get();
- return $datos->result();
Advertisement
Add Comment
Please, Sign In to add comment