Guest User

Untitled

a guest
Sep 26th, 2017
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $this->db->select("DATE_FORMAT(auto.fecha_reserva, '%d-%m-%Y') as fecha", FALSE);
  2. $this->db->from('auto');
  3. $datos=$this->db->get();
  4. return $datos->result();
  5.  
  6. $.each(obj.resultado, function (ind, elem) {
  7.  
  8. alert(typeof(elem.fecha));//retorna un String
  9. //necesito que elem.fecha sea un date.
  10. //lo ideal seria formatearla sin uso de plugins
  11.  
  12. });
  13.  
  14. $this->db->select("CONVERT(datetime, auto.fecha_reserva, 103) as fecha");
  15. $this->db->from('auto');
  16. $datos=$this->db->get();
  17. return $datos->result();
Advertisement
Add Comment
Please, Sign In to add comment