Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/11/2007, 14:20
rsanchez77
 
Fecha de Ingreso: septiembre-2007
Mensajes: 46
Antigüedad: 17 años, 7 meses
Puntos: 0
Re: Invertir Fecha

la idea que me diste es buena pero ahora nose como resolver el siguiente problema

trato de guardar esa fecha en una BD de MySql y el valor que se ingresa es 0000-00-00

de esta manera lo estoy haciendo

valor = InvertirFecha(Date(Request.Form("FechaRegistro"))) ;

var invertido = InvertirFecha(valor);

sql = "UPDATE certificados SET FechaCertificado = " + invertido + " WHERE idCertificado = 111";


// Esto es para invertir fecha
function InvertirFecha(strFecha)
{
if (String(strFecha) == "" || String(strFecha) == "undefined" || strFecha == null)
return "";
// Se obtiene la fecha
var o_date = new Date(strFecha);
date= o_date.getDate();
if (!date) return "";
month= o_date.getMonth()+1;
//if (offSetMes) month -= offSetMes;
year= o_date.getYear();
// Se resta el año en 1 por cada 12 meses bajo cero
return (year + "-" + month + "-" + date);
}


alomejor yo tengo algun codigo mal escrito