hhfa1990
6/22/2015 - 7:18 PM

javascript, js, fecha

javascript, js, fecha

function parseJsonDate(jsonDateString) {

	var meses = ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"];

  var date = new Date(parseInt(jsonDateString.replace('/Date(', ''))),
	  mes = date.getMonth(),
  	dia = date.getDate(),
  	anio = date.getFullYear();

    return dia+"-"+meses[mes]+"-"+anio;
}

var fechaFormateada = parseJsonDate("/Date(1354773600000)/");
console.log(fechaFormateada);